Interactive science lab/Algorithms
Sorting Algorithm Race Lab
Choose a sorting method and watch comparisons and data movement rearrange a random array into ascending order.
Live experiment · 2D canvasPAUSED
The science
What to observe
Sorting algorithms differ in how they compare and move values. Bubble sort repeatedly swaps adjacent inversions; insertion sort grows a sorted prefix; selection sort repeatedly places the smallest remaining value.