Demo lesson. Nothing saved.
How binary search finds a needle fast
The idea
card 1 of 3

Cut the haystack in half, every time

Looking for one name in a sorted phone book, you do not read every page. You flip to the middle, see whether your name is before or after, and throw away the half it cannot be in. Then you do it again on what is left.

That is binary search. Each check deletes half of what is still possible. A list of a million items is solved in about 20 checks, not a million, because halving twenty times gets you from 1,000,000 down to 1.

Kept Classroom