logo

AQA A-Level Computer Science practice

A search algorithm halves the remaining search area after each comparison. Which time complexity best describes the algorithm in the general case?

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

At a glance

MCQ

Type

practice

Style

Topic

Classification of algorithms

Exam-style question

Try this first

A search algorithm halves the remaining search area after each comparison. Which time complexity best describes the algorithm in the general case?.

  1. A.O(1)
  2. B.O(log n)
  3. C.O(n)
  4. D.O(n^2)

Answer and explanation

Concise answer

O(log n)

Why this is correct

If the remaining problem is repeatedly divided by two, the number of steps grows logarithmically with 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