Sorting Visualizer Playground

Five sorts really run on your sacks of grain: every comparison and swap from the run, and sacks of equal weight show which sort is stable. An interactive…

Why it matters

Sorting is the doorway to algorithmic thinking: counting comparisons and swaps makes "O(n²) is slow" something you feel, and sacks of equal weight show what stable means, which matters as soon as you sort data in layers (orders by date, then by name).

The key idea

Every sort only compares and moves; what differs is which pairs and how far

Common mistakes

Try it in this playground