Bubble sort in C

In this tutorial, we will see about Bubble sort in c.

Bubble sort is one of the simplest sorting algorithm.In bubble sort,You need to compare adjacent elements and swap them if there are not in correct order.
Here is simple program for bubble sort.

Output:

Enter the size of array: 5
Enter the array elements: 65
45
87
32
98

Both worst case and average case complexity is O (n^2) for bubble sort.
That’s all about Bubble sort in C.

Leave a Reply

Your email address will not be published. Required fields are marked *