Skip to content

Files

This branch is 7 commits ahead of, 422 commits behind trekhleb/javascript-algorithms:master.

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 3, 2018
May 24, 2018
Jun 22, 2018

Bubble Sort

Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.

Algorithm Visualization

Complexity

Name Best Average Worst Memory Stable Comments
Bubble sort n n2 n2 1 Yes

References