Visualisation

Dark Mode

10
9
8
7
6
5
4
3
2
1

Comparing

Sorted

Sorting Algorithm
10
0.2s per swap

Bubble Sort


Bubble sort works by repeatedly swapping adjacent elements if they are in the wrong order. The largest element passes through to the end of the list, and this repeats until all elemnts are sorted.


Big O

Worst Case Time ComplexityO(n^2)
Best Case Time ComplexityO(n)
Average Time ComplexityO(n^2)