logo

AQA A-Level Computer Science practice

An expression tree has * as its root. Its left subtree has + as its root with leaves a and b, and its right subtree is the leaf c. What postfix expression is produced by a post-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

An expression tree has * as its root. Its left subtree has + as its root with leaves a and b, and its right subtree is the leaf c. What postfix expression is produced by a post-order traversal?.

  1. A.* + a b c
  2. B.a b + c *
  3. C.a b c + *
  4. D.+ a b * c

Answer and explanation

Concise answer

a b + c *

Why this is correct

Post-order visits the left subtree, the right subtree, and then the current node. The left subtree produces a b +, followed by c, and then the root operator *, giving a b + c *.

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