logo

Question detail

A binary tree search starts at the root node with value 50. The left child is 30 and the right child is 70. The target value is 30. Which node is examined first, and what happens next?

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 starts at the root node with value 50. The left child is 30 and the right child is 70. The target value is 30. Which node is examined first, and what happens next?.

  1. A.30 is examined first, so the search moves right
  2. B.50 is examined first, then the search moves left
  3. C.70 is examined first, then the search moves left
  4. D.50 is examined first, then the search moves right

Model answer

What a good answer should say

  • B.
  • 50 is examined first, then the search moves left

Explanation

Why this works

A binary tree search begins at the root. Since 30 is less than 50, the search follows the left branch after examining 50.

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.