Algorithms
Sorting, searching, and traversal — with the comparison counter running, so the complexity is a number you watch rather than a claim you accept.
- SortingWhy the comparison sorts stop at n log n, why the library beats your quicksort, and why stability is the property that actually decides which one you need.
- SearchingBinary search, the off-by-one that survives every test, and why the useful version is not "find x" but "find the boundary".
- Two PointersTurning a nested loop into a single pass by proving that one direction of movement is always safe — plus fast/slow pointers, which detect cycles in constant space.
- Sliding WindowReusing the previous answer instead of recomputing it — and the monotonicity requirement that decides whether the window is allowed to shrink.
- RecursionTrusting the recursive call, counting the stack, and why Python and JavaScript will not save you with tail-call optimisation.