CAMBRIDGE AS & A LEVEL · SEARCH
Linear search.
Check one value at a time until the target is found or the list ends.
THE VISUAL TRACE
00 / 10Follow the values
Ready to explore
Press Play or Next step to begin. No values have been checked yet.
[]
12
17
225
34
418
59
6 current checked / fixedindex starts at 1
SEARCH TARGET18
NOW IN THE ALGORITHM
Press Play to begin.01 / THE IDEA
What should you notice?
A linear search works on unsorted data. It checks values in order and stops when it finds the target.
02 / KEEP PRACTISING
Change the outcome.
Try a first value, a last value, a missing target, duplicates, negative numbers, and a single value. Use the slider to revisit any step.
Explore more 9618 lessons ↗