14 lessons
Linear Search
Check every item one by one. The simplest search there is, and sometimes the only one that works.
Binary Search
Halve the search space every step to find an element in logarithmic time, and recognise the problems that hide a binary search inside them.
Jump Search
Skip ahead in fixed steps, then walk back. A middle ground between linear and binary search.
Interpolation Search
Guess where the value probably is instead of always splitting down the middle.
Exponential & Fibonacci Search
Two ways to find a range first, then search inside it — useful when the array is huge or seeking is expensive.
Bubble Sort
Repeatedly swap neighbours that are out of order until nothing moves.
Selection Sort
Find the smallest item, put it first, repeat. Minimal swaps, but never fast.
Insertion Sort
Build a sorted section one item at a time, exactly how you sort a hand of cards.
Merge Sort
Split in half, sort each half, then zip them together. Guaranteed n log n, every time.
Quick Sort
Pick a pivot, push smaller left and bigger right, then repeat on each side.
Heap Sort
Turn the array into a heap, then repeatedly pull out the largest. O(n log n) guaranteed, with no extra memory.
Counting Sort
Tally how many times each value appears, then rebuild the array. No comparisons at all.
Radix Sort
Sort by the last digit, then the next, and so on. The order appears without a single comparison.
Searching & Sorting Cheat Sheet
Every algorithm side by side, with a decision guide for picking the right one under pressure.