SR

← Blog

Binary search, step by step

Algorithms · Interactive

Given a sorted list, look at the middle item. If it's too big, discard the right half; too small, discard the left half. Repeat. Each step halves the search space, so 16 items take at most 5 steps.