Gale–Shapley Stable Matching

A stable matching always exists and is findable in O(n^2), but it's optimal for the proposing side. Mechanism design in twenty lines.

Max-Flow Min-Cut

The bottleneck equals the capacity, exactly. A duality result you can see, and the workhorse behind matching and segmentation.

Competitive Analysis and Ski Rental

How to reason about decisions made without the future, with a provable ratio. Rent-vs-buy shows up in caching, autoscaling, and connection pooling.

Amortized Analysis and the Potential Method

Why a dynamic array's O(n) resize is still O(1) per push, and how to prove it rather than hand-wave it.

Linearity of Expectation

Expectations add even when events are hopelessly dependent. Averaging as an existence proof: if the mean is 5, some input hits 5.