logo

AQA A-Level Computer Science practice

What does the time complexity O(n) mean for a linear search?

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

At a glance

MCQ

Type

practice

Style

Topic

Searching algorithms

Exam-style question

Try this first

What does the time complexity O(n) mean for a linear search?.

  1. A.The number of comparisons is unrelated to the number of items.
  2. B.The number of comparisons can grow in proportion to the number of items.
  3. C.The search always makes exactly one comparison.
  4. D.The search always makes the same number of comparisons as a binary search.

Answer and explanation

Concise answer

The number of comparisons can grow in proportion to the number of items.

Why this is correct

For a list with n items, a linear search may need to examine each item. Therefore, the amount of work grows linearly as n increases, giving a time complexity of O(n).

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