AQA · GCSE · Computer Science · Higher
Linear search process
Explain how the linear search algorithm works.
Write your answer first. You can study the marking guidance whenever you need it.
Study the marking See what earns credit and compare it with a full-mark answer.
Marking points
- 1 May identify the start position at one end of the list.
- 2 May describe moving sequentially through positions.
- 3 May describe comparing each current value with the target.
- 4 May describe stopping when a match is found.
- 5 May describe reporting absence after the entire list is checked.
Full-mark answer
Start at one end of the list and compare each item with the search value in sequence. Stop when a matching item is found. If the other end is reached with no match, the value is not in the list.
Why this answer loses marks
It repeatedly splits an ordered list into halves until the item is found.
That describes binary search. Linear search checks entries sequentially and also needs a not-found outcome.