☰
←
Back
Learnvas
Lesson
Binary search
Programming
↗
Share
1/6
Prev step
Continue →
Light
Dark
Auto
Step 1 of 6
← → to move · space to autoplay
The idea
The list must be sorted.
Look at the middle value.
If it's too small, the answer is on the right. If it's too big, it's on the left.
Repeat on the half that's left.
🎨 What happens if the number isn't in the list?
🎨 Why must the list be sorted?
🎨 What does O(log n) mean?
Ask the tutor
Ask
🎨
Show me