Could you find a pupil in a sorted school register without starting at the top?
Your school is checking pupils in for a trip. The register is sorted by pupil number, and you need to find pupil one hundred and forty-two. Where would you look first if you wanted to skip as many names as possible?
With linear search, you test the first pupil number. If it matches, you stop. If it doesn't match and there's another entry, you test the next one. If you run out of entries, the target wasn't found. The register can be in any order.
Watch the middle entry light up: one hundred and twenty-seven. Your target, one hundred and forty-two, is larger. The numbers are sorted, so you can rule out that middle entry and everything to its left. Look at the middle of what's left, and there's your match. That's binary search.
You're looking for twenty in this sorted list. You've just tested the middle entry, twenty-eight. Think about where a smaller number could be, then pick the entries you should keep searching.
The lower and upper bounds mark the first and last positions left. Average them and round down to find the middle. If the target matches, stop. If it's larger, move the lower bound just past the middle. If smaller, move the upper bound just before it. Stop if lower passes upper.
Find thirty-six. Start with bounds one and seven. Their average is four. At position four, thirty-one is too small, so keep positions five to seven. Those bounds average to six. At position six, forty-three is too large, so keep only position five. There, thirty-six matches.
Now look for twenty-one in a different sorted list. Start at the middle, then use each comparison to decide which bound moves past the tested position. Pick the values you test, in order, before the range is empty.
In the worked trace, after you test position four, only positions five to seven remain. If you go back to the full list, you just pick position four again. Take the middle of the remaining range instead. This time it's position six.
Linear search works in any order. Binary search needs a sorted register so the middle value tells you which side to keep. Linear search may test every entry. Binary search cuts the remaining range roughly in half after each mismatch, so it usually makes far fewer comparisons on a large sorted register.
If the question says ‘Explain how a binary search works’, give the reason for each move. For example, thirty-six is bigger than thirty-one, so you can drop the middle and everything to its left. A list of tested values alone doesn't explain why you chose them.