GATE Computer ScienceHardGATE CSE · NIELIT

A binary tree has preorder 8 3 1 6 4 7 10 14 13 and inorder 1 3 4 6 7 8 10 13 14. What is its postorder traversal?

  1. A. 1 4 7 6 3 14 13 10 8
  2. B. 1 4 7 6 3 13 14 10 8
  3. C. 1 3 4 7 6 13 14 10 8
  4. D. 1 4 6 7 3 13 14 10 8

Correct answer: B. 1 4 7 6 3 13 14 10 8

The root is 8; 3's subtree is {1,3,4,6,7} and 10's is {10,13,14}. Postorder: 1 4 7 6 3 13 14 10 8.

More Programming and Data Structures (GATE) questions

Exams that ask this topic