Linear Search

Computer ScienceOCRGCSEUnit: 3.1 Fundamentals of Algorithms
Free taster
5 of 6 sections open
The basics

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
Key terms

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

Revise every Computer Science topic, free during alpha

Linear Search is one of 60 topics on PrepWise — all aligned to your exam board.

Start revising free →