sort
Sorting
Putting things in order, and why how matters.
01 play_circle 02 play_circle 03 play_circle 04 play_circle 05 play_circle 06 play_circle 07 play_circle 08 play_circle 09 play_circle
Bubble Sort
Compare neighbours, swap if they're wrong. Repeat until calm.
Selection Sort
Find the smallest. Put it in front. Repeat.
Insertion Sort
How you actually sort a hand of cards, without being taught.
Merge Sort
Split until it's trivial, then merge back in order.
Quick Sort
Pick a pivot, split around it, and let the halves sort themselves.
Heap Sort
Turn the array into a heap, then keep taking the biggest off the top.
Shell Sort
Insertion sort, but values are allowed to leap instead of crawl.
Counting Sort
Sorts without comparing anything — and that's how it beats n log n.
Radix Sort
Sort by the last digit first. It sounds backwards, and it's the only way it works.