logo

Question detail

A binary tree contains these values: root 40, left child 20, right child 60, and the right child of 20 is 30. Which sequence of values is examined when searching for 30?

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 contains these values: root 40, left child 20, right child 60, and the right child of 20 is 30. Which sequence of values is examined when searching for 30?.

  1. A.20, 30
  2. B.40, 60, 30
  3. C.40, 20, 30
  4. D.40, 20, 60, 30

Model answer

What a good answer should say

  • C.
  • 40, 20, 30

Explanation

Why this works

The search starts at 40. Since 30 is smaller, it moves to 20.

Since 30 is larger than 20, it then moves to 30.

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.