Bubble Sort in C

Here you will learn about program for bubble sort in C.

Bubble sort is a simple sorting algorithm in which each element is compared with adjacent element and swapped if their position is incorrect. It is named as bubble sort because same as like bubbles the lighter elements come up and heavier elements settle down.

Both worst case and average case complexity is O (n2).

Bubble Sort in C



Enter the size of array: 4
Enter the array elements: 3 7 9 2

Array after sorting: 2 3 7 9


Comment below if you have any doubts related to above program for bubble sort in C.

5 thoughts on “Bubble Sort in C

Leave a Reply

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