Sorts
I learn best by watching things move. These are interactive, in-browser visualizers for classic computer science algorithms: press play, scrub through the steps, and watch the source highlight line by line as it runs.
Line every sort up and race them on the same data. Watch who finishes first, how many comparisons it took, and how much scratch memory each one needed.
Introsort is the one that actually ships in your standard library. It starts as quick sort, bails to heap sort if the recursion goes too deep, and finishes tiny pieces with insertion sort. Watch it run step by step.
Merge sort splits the array in half over and over, then zips the sorted halves back together into one run. Watch it run step by step.
Quick sort picks a pivot, shoves everything smaller to one side and bigger to the other, then does the same to each side. Watch it run step by step.
Heap sort treats the array like a binary tree, floats the biggest value to the top, parks it at the end, and repeats. It sorts in place and never has a bad day. Watch it run step by step.
Shell sort is insertion sort with a head start, comparing items far apart first and shrinking the gap each round so the last pass barely has to move anything. Watch it run step by step.
Insertion sort grows a sorted run on the left, lifting each new value out and sliding it back past everything bigger until it drops into place. Watch it run step by step.
Selection sort sweeps the unsorted part for the smallest value and swaps it to the front, locking one more slot every pass. Watch it run step by step.
Cycle sort is the one obsessed with not writing to memory. It figures out exactly where each value belongs and puts it there in a single write, at the cost of a lot of comparisons. Watch it run step by step.
Bubble sort in its simplest form — two loops that, for each slot, sweep everything to its right and swap in the smallest value. Watch it run step by step.
More sorts coming weekly.