GATE | Sudo GATE 2020 Mock III (24 January 2019) | Question 45

The pre-order traversal of a binary tree is given by,

12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20 

Then the post-order traversal of this tree is:
(A) 2, 6, 7, 8, 9, 10, 12, 15, 16, 17, 19, 20
(B) 2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12
(C) 7, 2, 6, 8, 9, 10, 20, 17, 19, 15, 16, 12
(D) Data not sufficient.


Answer: (D)

Explanation: Since we need also inorder traversal to construct this binary tree but inorder traversal is not provided.

Note that it is not mentioned that given tree is binary search tree, so any sequence of inorder is possible (i.e., sorted inoreder is not necessary.).

Option (D) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.