Exams › GATE › Technical
The inorder and preorder traversals of a binary tree are d b e a f c g and a b d e c f g, respectively. The postorder traversal of the binary tree is
- d e b f g c a
- e d b g f c a
- e d b f g c a
- d e f g b c a
Correct answer: d e b f g c a
Solution
From preorder, the root is a. Splitting inorder around a gives left subtree d b e and right subtree f c g; recursively reconstructing both subtrees yields postorder d e b and f g c. Combining them with the root gives d e b f g c a.
Related GATE Technical questions
⚔️ Practice GATE Technical free + battle 1v1 →