Bubble Sort using C Program

The bubble sort Algorithm simply compares adjacent elements and exchanges them if they are out of order.

To apply the Bubble Sort we follow the following steps.

  • Compare 1st two elements and exchange them if they are out of order.
  • Move down one element and compare 2nd and 3rd elements. Exchange if necessary. Continue until end of array.
  • Pass through array again, repeating process and exchanging as necessary.
  • Repeat until a pass is made with no exchanges.

Question : Write a c program for quick sort.

In this lesson we will learn how to write a source code in C programming language for doing simple bubble sort using array in ascending order.


Partner Sites