
How fast can you find a book in a library without a map?
How fast can you find a book in a library without a map?
Imagine you're looking for a specific book in a library without any organization. You'd have to check each shelf one by one, which can take forever, especially if the library is huge.
Think of the library as a list. Instead of checking each shelf (or list item) one by one, you split the library in half and eliminate half of the shelves each time, narrowing down where your book might be.
Example
If you have 1024 books, instead of checking all 1024 shelves, you check 512, then 256, then 128, and so on, until you find your book.
Remember this
This method, called binary search, drastically reduces the time it takes to find something in a large, unsorted list.
Text adapted from Wikipedia, licensed under CC BY-SA 4.0.
Glossary of computer science
Ever wondered how computers organize data efficiently?
History of the Hindu–Arabic numeral system
Why did ancient scholars invent a new way to count?
Algorithm
Why do we need a faster way to analyze signals?
RSA cryptosystem
Why can't you just use any number for secret codes?
Quantum mind
Can quantum computers solve puzzles faster than our brains?
Time in physics
Ever wondered why mixing things up makes them harder to sort?
Swipe through 100 ML concepts daily
Open Pocket Polymath