CAMBRIDGE IGCSE · SEARCH

Linear search.

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

All 0478 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
1
7
2
25
3
4
4
18
5
9
6
]
current checked / fixedindex starts at 1
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 0478 lessons ↗