logo

Question detail

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, check the answer, then read the explanation to understand the curriculum point.

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

Model answer

What a good answer should say

  • a b + c *

Explanation

Why this works

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 *.

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.