sort — a sorting-algorithm visualiser

A standalone web page where you can watch classic sorting algorithms do their thing. I built it partly as a teaching aid — when you’re tutoring someone who’s just met their first algorithm, “look, here’s bubble sort actually being slow” is worth a thousand whiteboard explanations.

What it does

Pick a starting distribution (random, reversed, nearly-sorted, …), choose an algorithm, and watch it run in real time — comparisons, swaps, and how the access pattern differs between something like insertion sort and a divide-and-conquer like merge sort. There’s a step-by-step mode and an audio cue on every comparison, so you can hear the algorithm too.

Built with

Pure HTML + CSS + JavaScript — no framework, no build step, no dependencies; the whole thing is a single index.html. Each algorithm is written as a generator that yields at every step, which cleanly separates the sorting logic from the animation and lets the same code drive both auto-play and manual stepping.