logo

AQA A-Level Computer Science practice

Explain why binary search has a time complexity of O(log n). In your answer, describe what happens to the remaining search range after each comparison.

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 binary search has a time complexity of O(log n). In your answer, describe what happens to the remaining search range after each comparison.

Answer and explanation

Concise answer

At each comparison, binary search checks the middle item of the current range.

Why this is correct

The key feature is repeated halving. The algorithm does not examine every item in turn; each comparison substantially reduces the number of possible positions that still need to be checked.

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