Skip to content

lab: algorithms

Binary search, step by step

Find one number in a sorted list by throwing away half of it every step.

Tap any bar to search for it.

Looking for 74

Binary search steps
0
Checking one by one would take
20
For 10 lakh numbers, at most
20 steps
  1. Press “Next step” to look at the middle of the list.