logo

AQA A-Level Computer Science practice

Explain why the time complexity of a linear search is O(n). Include what can happen when the target is near the end of the list or is not present.

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

practice

Style

Topic

Searching algorithms

Exam-style question

Try this first

Explain why the time complexity of a linear search is O(n). Include what can happen when the target is near the end of the list or is not present.

Answer and explanation

Concise answer

A linear search checks list items one at a time.

Why this is correct

The key point is that the search may inspect all n elements. Finding a target early can stop the search sooner, but it does not change the overall O(n) classification because the amount of work can still grow linearly with the list size.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions