The quiet of putting
things in order.
Eighteen sorting algorithms, animated bar-by-bar and scored with Web Audio.
A catalog of eighteen
ways to make a line.
Each one annotated with its best, average, and worst complexity — plus whether it's stable, in-place, or both. Click any card to watch it work.
Bubble Sort
Repeatedly swap neighbors that are out of order.
Insertion Sort
Grow a sorted prefix by inserting each element into place.
Selection Sort
Find the smallest item remaining; put it at the front.
Cocktail Shaker Sort
Bubble sort, but sloshing both directions each pass.
Gnome Sort
A gnome walks the row, swapping backward until it fits.
Shell Sort
Insertion sort on shrinking gaps — breaks up the O(n²) wall.
Merge Sort
Divide in half, sort each half, merge them back.
Quick Sort
Pick a pivot, partition, recurse. Fast in practice.
Heap Sort
Build a max-heap, repeatedly extract the top.
Radix Sort (LSD)
Stable-bucket by digit, least significant first.
Counting Sort
Tally each value, then fill the array back in order.
TimSort
Hybrid adaptive mergesort — what V8, lodash, Ramda, and Python actually use.
Bogo Sort
Shuffle until sorted. Joke algorithm — capped to stay polite.
Sleep Sort
Just for fun: each value naps proportionally, then wakes up in order.
Quantum Bogosort
Just for fun: shuffle once, destroy the universe if it isn't sorted.
Purge Sort
Just for fun: anything out of order is silently rewritten to fit.
Slowsort
Just for fun: "multiply and surrender" — a parody of divide-and-conquer.
Miracle Sort
Just for fun: check if it's sorted; if not, wait for cosmic rays.