Bubble Sort is one of the simplest sorting Algorithms, but not very efficient. It puts a list of numbers in increasing order by comparing adjacent elements, exchange them if not in order. Bubble Sort exchanges larger elements with smaller ones following it until sort is complete. Smaller elements "bubble" to the top as they exchange with larger elements and larger elements "sink" to the bottom.
Pseudo Code for Bubble Sort Algorithm
Procedure BubbleSort(A1, ... , An : real numbers with n >= 2)
for i := 1 to n - 1
for j := 1 to n - 1
if Aj > Aj+1 then exchange Aj and Aj+1
{A1, .... An is in increasing order}
C Plus Plus Program For Bubble Sort Algorithm