Binary Search / Ordered Windows / Invariants

Binary Search

These visualizers teach the real reason binary search works: every step preserves an invariant about where the answer can still live, whether the structure is a flat array, a rotated array, duplicate boundaries, a matrix, or a partition across two arrays.