AlgoScope

Binary Search (recursive view)

AlgorithmbeginnerDivide and Conquer

Each call probes the middle and recurses into the half that can still hold the target; depth O(log n).

Decision · step 3 of 8Search Variants: Binary search as a call stack
active 0-920518212316✓4235386567728919lowmidhigh16 < 72

16 is below 72, so the answer can only be to the right: search 5 to 9. That is a new call on top of this one.

Open in the player →or start at step 3

What you will see

Each frame holds a half; only one child is ever opened.

How search variants works →

Cost

BestO(1)
AverageO(log n)
WorstO(log n)
SpaceO(log n)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input.

Screen readers: Each call frame announces its range and result; each step announces split, recurse or combine.

Reduced motion: Frames appear and disappear with crossfades; ranges highlight without motion.

A variant of

Taught by the same lesson

Search Variants covers these too, in the same run.