A little order.
A lot to discover.

Watch nine sorting algorithms think through the same numbers. Pause at a comparison, step back, or race two approaches to see why their work differs.

Start with five numbers

Try 42, 7, 19, 3, 88 with Bubble sort. Step forward to watch neighbouring values trade places. Then race it against Quicksort.

0 / 0
Comparing Swapping / writing Pivot or current minimum In final position Space play · ←→ step · R restart · N new input · drag the chart to scrub

Same data, nine algorithms

Every algorithm runs on the exact array shown on the bench above. Change the input shape or size and this table re-measures. Select a row to load that algorithm.

#Algorithm ComparisonsSwapsWritesTotal work Relative work (log scale)Average case

Record once, replay anywhere

The algorithms never touch the screen. They run to completion first, and the page plays back what they did.

01 · Record

Run against a tracer

Each algorithm sorts a copy of the array through a tracer that logs every compare, swap and write, plus the pseudocode line it came from.

{ t: 's', i: 4, j: 5, l: 6 }
02 · Replay

Draw from the log

The canvas replays the log at whatever speed you pick. Because the log is fixed, playback runs forwards or backwards equally well.

03 · Checkpoint

Jump without waiting

A snapshot is stored every 512 operations, so any point on the timeline is at most 512 replays away. Bubble sort on 256 bars is about 50,000 operations and still scrubs instantly.