Networking
Explainer
Find anything in 20 guesses
You can find one name among a million in 20 guesses
Quick check · tap an answer to continue
Lesson notes
Key points
- Binary search works on sorted lists: check the middle, then drop the half that cannot match.
- Every step halves what is left, so a million shrinks to one in about twenty steps.
- Its time grows with log n, which is why sorted data is so valuable.
Definitions
- O(log n)
- Work grows with the number of halvings, not the number of items
Takeaway: Halve the problem each step
Quick check: Binary search needs the list to be…
- Sorted
- Short
- Random
Binary search only works on sorted data.
Binary searchHalvingLog n
Lessons like this, for your syllabus.
Short narrated study videos written for your course, level and exam. Free to start.
Get lessons for your own syllabus