logo

AQA A-Level Computer Science practice

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 first, then check the answer and practise the same topic again.

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

Answer and explanation

Concise answer

40, 20, 30

Why this is correct

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

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