OCR A LEVEL · SEARCH

Linear search.

Check one value at a time until the target is found or the list ends.

All H446 lessons
THE VISUAL TRACE

Follow the values

00 / 10
Ready to explore

Press Play or Next step to begin. No values have been checked yet.

[
12
0
7
1
25
2
4
3
18
4
9
5
]
current checked / fixedindex starts at 0
SEARCH TARGET18
NOW IN THE ALGORITHMPress 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 H446 lessons ↗