The preorder traversal sequence of a binary search tree is 100, 90, 50, 10, 60, 95, 93, 99, 150, 130, 125, 135, 200, 180, 250. Which one of the following is the postorder traversal sequence of the same tree?
(A) 10, 60, 50, 90, 93, 99, 95, 100, 125, 135, 130, 150, 180, 250, 200
(B) 10, 60, 50, 93, 99, 95, 90, 125, 135, 130, 180, 250, 200, 150, 100.
(C) 10, 60, 50, 93, 99, 95, 90, 125, 135, 130, 180, 250, 200, 150, 100
(D) None of these


Answer: (C)

Explanation: Finding postorder traversal of BST from preorder traversal:
In order of a given BST is always sorted. So, inorder is:

10, 50, 60, 90, 93, 95, 99, 100, 125, 130, 135, 150, 180, 200, 250 

Now inorder and preorder is given and we can construct BST with these.

\"\"

Therefore, post-order will be:

10, 60, 50, 93, 99, 95, 90, 125, 135, 130, 180, 250, 200, 150, 100 

So, option (C) is correct.


Quiz of this Question


  • Last Updated : 14 Nov, 2018

Share your thoughts in the comments