A comparison must tell you which side can be discarded safely.
Binary Search
6 chapters · 10 challenges · The Split Peaks
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What is binary search?
Binary search uses a yes-or-no comparison to discard an impossible half of an ordered search space. The search space can be array indices or every feasible answer to a constraint.
Think of guessing a page number. Open the book near the middle. If the page you want is later, the entire first half is no longer useful.
Every valid decision must remove a whole region, not just one candidate.
Decide whether low and high are possible answers before writing the loop.
A monotonic feasible/not-feasible rule can be searched even without a stored array.
Halve the only possible range
Exact Search
0/1 completePractice exact search through 1 visual expedition.
Boundary Search
0/3 completePractice boundary search through 4 visual expeditions.
Search On Answer
0/2 completePractice search on answer through 2 visual expeditions.
Rotated Arrays
0/2 completePractice rotated arrays through 2 visual expeditions.
Matrix Search
0/1 completePractice matrix search through 1 visual expedition.
Final challenge
0/1 completeCombine the skills from this world in a final challenge.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.