logo

AQA A-Level Computer Science practice

Consider this tree: M is the root; M has left child F and right child T; F has left child C and right child H; T has left child R and right child W. What is the pre-order traversal?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Tree-traversal

Exam-style question

Try this first

Consider this tree: M is the root; M has left child F and right child T; F has left child C and right child H; T has left child R and right child W. What is the pre-order traversal?.

  1. A.M, F, C, H, T, R, W
  2. B.C, F, H, M, R, T, W
  3. C.C, H, F, R, W, T, M
  4. D.M, T, W, R, F, H, C

Answer and explanation

Concise answer

M, F, C, H, T, R, W

Why this is correct

Pre-order visits the current node first, then the left subtree, and then the right subtree. Starting at M gives M, F, C, H, T, R, W.

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