Locker 37 is missing from a sorted list. Can you prove it without checking every ID?
You're at a station looking for locker thirty-seven. The screen lists the locker IDs in order, but you don't spot yours. How could you prove it's missing without checking every ID on the screen?
You already know linear search. It checks the locker IDs one at a time, starting at twelve. If you use the basic version and thirty-seven is missing, you reach the end after checking all seven IDs. This works even if the list is unsorted.
Start in the middle and test thirty-one. You're looking for thirty-seven, so thirty-one is too small. The IDs are sorted from smallest to largest, so everything to its left is too small as well. You can drop that whole group in one go.
Use the same sorted locker list, but look for twenty-four this time. Your first test is still thirty-one. Which group contains all the IDs this comparison lets you rule out? Pick the full group.
This is binary search. Low and high mark the first and last indices left, starting at zero and six here. Average them and round down for middle. If the ID matches, you're done. If it's too small, set low to middle plus one. If it's too large, set high to middle minus one.
Here are the sorted IDs. Low zero, middle three, high six: thirty-one is too small, so drop indices zero through three. Low four, middle five, high six: forty-five is too large, so drop five and six. All three indices are now four. Thirty-eight is too large. Drop four. High falls below low: not found.
Search for six in the sorted list two, four, eight, ten. Start your indices at zero and round the middle index down. When no indices are left, what are low and high? Pick the pair.
If the ID is too large, setting high to middle keeps the tested index. Set high to middle minus one. If the ID is too small, setting low to middle also keeps the tested index. Set low to middle plus one. Now every miss shrinks the interval, so the search must end.
For seven entries, the worst case is seven tests for linear search and three for binary search. For fifteen, it's fifteen and four. For thirty-one, it's thirty-one and five. Linear tests grow in proportion to list size. Binary tests grow logarithmically because each miss leaves at most half the entries.
If asked to explain one advantage and one limitation, compare the two searches directly. Binary search needs fewer tests in the worst case on large lists because each miss rules out at least half the remaining entries. It relies on sorted order for that step. Linear search can use unsorted data as it is.