Makes repeated passes through a list of numbers, and on each pass adjacent numbers are compared and reversed if they are not in the required order. Each pass will put at least one more element into the correct position, like bubbles rising, and the process is complete when a complete set of comparisons is made which required no switching.
http://www.sorting-algorithms.com/bubble-sort A demonstration of the bubble sort in action.