Free taster
5 of 6 sections open
Finding the Needle
Finding the Needle
Looking for something in a list? You have two strategies. Linear search is like looking for a word in a dictionary by starting at page 1 and reading every word - simple but slow. Binary search is how you actually use a dictionary - open to the middle, decide if your word is before or after, then repeat. Binary is MUCH faster, but the dictionary must be alphabetical (sorted)!
What does linear search do?: Checks each item from start to end until found
Computer Science glossary
- What does linear search do?
- Checks each item from start to end until found
Now try it yourself
Quiz · Question 1 of 15
How does a linear search work?
Tap an answer to check it