Linear search: how it works
Checks each item in a list in turn, from the start, until the target is found or the end of the list is reached. It works on unsorted data.
Understanding Linear search: how it works in IGCSE Computer Science Paper 2
What it does: Index 1 is the first item. If Names[1] equals the target, the search can finish after just one comparison. The loop runs through all 10 items. When the target is last or missing, a linear search makes all 10 checks. The search checks 4, then 9, then 7. It stops at 7, which is the third item, so 3 checks are made. On average the target is somewhere near the middle, so about half of the items (around 50) are checked. Checks each item in a list in turn, from the start, until the target is found or the end of the list is reached. It works on unsorted data.
Common mistakes: The flag must start as FALSE because the target has not been found yet. If it starts as TRUE, the search would report found even when the target is not in the list. It should be Found ← FALSE. The list has 10 items, so the loop must check every one, from 1 to 10. Stopping at 9 means the last item is never checked. It should be FOR I ← 1 TO 10.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 286–295) and word search (Modules 275–295).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
linear searchFill in the Blanks
Spot the Error
Student with a class code? Join your class →