It is possible to construct a binary tree uniquely whose pre-order and post-order traversals are given?
View worked solution
Answer: 0
The statement is FALSE (represented as 0).
To uniquely construct a binary tree, we need either:
- Pre-order and In-order traversals, or
- Post-order and In-order traversals.
Pre-order and Post-order traversals are not sufficient to uniquely reconstruct a general binary tree because we cannot unambiguously determine whether a single child of a node is a left child or a right child.
Counterexample:
Consider a binary tree with two nodes, and . Let:
There are two distinct binary trees that yield these same traversals:
- is the root, and is its left child.
- is the root, and is its right child.
Since we cannot uniquely distinguish between these two structures, the statement is false.
Free practice · Your answers on this page are not saved.
