Learn basic concept of c , c++ and python programming in regularcodes.com

Spread the post

C Bubble sort

Time complexity of this program O(n^2)

Below in C implementation of this problem.

Accepted Output

Before sort : 34, 13, 112, 63, 123, 456, 131, 46, 23, 121, 45

After Sort Bubble

data is : 13, 23, 34, 45, 46, 63, 112, 121, 123, 131, 456

Output
 Before sort data is :
[0] 34
[1] 13
[2] 112
[3] 63
[4] 123
[5] 456
[6] 131
[7] 46
[8] 23
[9] 121
[10] 45
 After sort data is:
[0] 13
[1] 23
[2] 34
[3] 45
[4] 46
[5] 63
[6] 112
[7] 121
[8] 123
[9] 131
[10] 456 

Spread the post