ResourcesAlgorithm
Algorithm
visualisationsWatch it, then write it
Reading pseudocode and imagining what it does is the hard way to learn an algorithm. These pages show you instead: bars swap into place, the current line of code lights up, and the comparison and swap counters tick along beside it.
Press play to watch a whole run, or step through one operation at a time. Change the speed, change the size, or type in your own numbers and watch what happens to them. Everything runs in your browser and nothing asks you to sign up.
Browse
1 visualisation
On the list: Searching, Data structures, Graph algorithms, Recursion. Want one of them sooner? Tell us.
How to get the most out of these
- Play it once at full speed to get the shape of the thing, then slow it down.
- Step through the interesting part by hand. The code panel shows which line is executing on every frame, which is where the click usually happens.
- Break it on purpose. Try the best and worst cases, and type in input designed to be awkward — duplicates, already-sorted, exactly reversed.
- Then close the page and write it from memory. Watching is not the same as knowing.