Bubble sort

From Wiki :-)
Revision as of 04:52, 28 May 2018 by Savoundg (talk | contribs) (Savoundg moved page Bubblesort to Bubble sort)
Jump to navigation Jump to search

Bubble sort is the simplest exchange sorting algorithm.

Each element of the array is compared (and swapped if bigger) with every other element of the array.

The worst-case and average complexity is O(n2).

This algorithm should only be used on almost sorted array (that implies few permutations).

Resources

https://en.wikipedia.org/wiki/Bubble_sort