Bubble sort visualization

Estimated iterations (worst case): 
 Elapsed time: 
00:00
 Iterations: 

A sorting algorithm is used to organize data according to a user-defined criteria. Bubble sort is a very simple sorting algorithm, used mostly for educational purposes. The reason for that is speed, as Bubble sort is very slow at sorting large sets of data, but very easily understandable.

Bubble sort works by comparing an element to its predecessor, and swapping their positions if the element is smaller. This idea is repeated for every pair of consecutive elements in a array, until no swaps happen, which means the elements are sorted.

Time complexity: average case: O(n²), best case: O(n), worst case: O(n²)