Binary Search / Ordered Windows / Invariants
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.
Trace the Find First and Last Position algorithm from parsed input through each decision point.
Trace the Find Minimum in Rotated Sorted Array algorithm from parsed input through each decision point.
Trace the Find Peak Element algorithm from parsed input through each decision point.
Binary-search the smaller array until both partitions agree on the median boundary.
Trace the Search a 2D Matrix algorithm from parsed input through each decision point.
Trace the lower-bound binary search that returns the found index or insertion point.
This visualizer shows why rotation does not break binary search: one half of the current window is always still sorted, and that is enough information to throw half the window away.