Algorithm visualizer
Pick an algorithm, enter your own numbers or use a preset, then step through the run. The pseudocode and the explanation follow each step.
Look at the middle of a sorted range, then discard the half that cannot contain the target.
Precondition: The array must be sorted from smallest to largest.
Use the Missing preset, then predict the last range before the search stops. Check it with the steps.
Step 1 of 5
Set lo = 0 and hi = 7. The search range is the whole array.