Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

UGC-NET | UGC-NET CS 2017 Dec 2 | Question 25

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Postorder traversal of a given binary search tree T produces following sequence of keys:
3, 5, 7, 9, 4, 17, 16, 20, 18, 15, 14
Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?
(A) 3, 4, 5, 7, 9, 14, 20, 18, 17, 16, 15
(B) 20, 18, 17, 16, 15, 14, 3, 4, 5, 7, 9
(C) 20, 18, 17, 16, 15, 14, 9, 7, 5, 4, 3
(D) 3, 4, 5, 7, 9, 14, 15, 16, 17, 18, 20


Answer: (D)

Explanation: Since Inorder traversal of a BST always gives elements in increasing order. For this question sorted order of keys will always be the in-order tree traversal for post-order traversal.
So, option (D) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 15 Mar, 2018
Like Article
Save Article
Similar Reads