The postorder traversal of a binary tree is DEBFCA. Which of the following can…
2012
The postorder traversal of a binary tree is DEBFCA. Which of the following can be the preorder traversal?
Answer: C. ABDECF — ConceptIn a binary tree, preorder visits Root → Left → Right, while postorder visits Left → Right → Root. A postorder sequence fixes the root as its last…
- A.
ABFCDE
- B.
ADBFEC
- C.
ABDECF
- D.
None of the above
Attempted by 17 students.
Show answer & explanation
Correct answer: C
Concept
In a binary tree, preorder visits Root → Left → Right, while postorder visits Left → Right → Root. A postorder sequence fixes the root as its last node, but by itself it generally does not fix how the earlier nodes split into left and right subtrees.
Therefore, a unique preorder normally requires extra structural information, such as an inorder traversal or a fully specified tree.
Application
For DEBFCA, A must be the root because it is the last postorder node.
For ABDECF, the remaining nodes can split as DEB for the left subtree and FC for the right subtree. Taking B and C as those subtree roots produces preorder ABDECF and postorder DEBFCA.
The other explicit sequences cannot be paired with DEBFCA under the same preorder/postorder subtree-partition rule. Thus ABDECF is the compatible explicit choice.
Cross-check and result
Postorder alone is not unique: a one-child chain A → C → F → B → E → D also has postorder DEBFCA but preorder ACFBED. This confirms why the stem must ask which offered sequence can be the preorder, rather than claim that the preorder is uniquely determined.
Under that offered-choice reading, the result is ABDECF.