Consider the following expression tree. In-order, pre-order and post-order…
2022
Consider the following expression tree. In-order, pre-order and post-order traversal of this tree will result into which of the following expressions, respectively?

- A.
In-order: a + b c *
Pre-order: + a * b c
Post-order: a b c * + - B.
In-order: a b + * c
Pre-order: + a * b c
Post-order: a b c * + - C.
In-order: a + b * c
Pre-order: + a * b c
Post-order: a b c * + - D.
In-order: a * b + c
Pre-order: + a * b c
Post-order: a b c * +
Attempted by 723 students.
Show answer & explanation
Correct answer: C
The expression tree has root +, left child a, and right child * with children b and c.
In-order (Left-Root-Right): a + b * c
Pre-order (Root-Left-Right): + a * b c
Post-order (Left-Right-Root): a b c * +
Therefore, the correct option is the one that lists all three traversals in this order.