logo

Question detail

A binary tree search examines one node at the root and then follows one of the two branches. What is the main reason this produces logarithmic time complexity?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Searching algorithms

Exam-style question

Try this first

A binary tree search examines one node at the root and then follows one of the two branches. What is the main reason this produces logarithmic time complexity?.

  1. A.The search examines every node in the tree
  2. B.The search removes one node from consideration at each step
  3. C.The search follows one branch, reducing the remaining search area at each step
  4. D.The search sorts all nodes before examining them

Model answer

What a good answer should say

  • C.
  • The search follows one branch, reducing the remaining search area at each step

Explanation

Why this works

At each comparison, the search chooses one branch rather than continuing through both parts of the tree. This repeated reduction gives the required O(log n) time complexity.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.