GATE | Gate IT 2008 | Question 70
A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys.
I. 81, 537, 102, 439, 285, 376, 305
II. 52, 97, 121, 195, 242, 381, 472
III. 142, 248, 520, 386, 345, 270, 307
IV. 550, 149, 507, 395, 463, 402, 270
Which of the following statements is TRUE?
(A) I, II and IV are inorder sequences of three different BSTs
(B) I is a preorder sequence of some BST with 439 as the root
(C) II is an inorder sequence of some BST where 121 is the root and 52 is a leaf
(D) IV is a postorder sequence of some BST with 149 as the root
Answer: (C)
Explanation: A: I and IV are not in ascending order
B: If 439 is root, It should be 1st element in preorder
D: If 149 is root, It should be last element in postorder
Quiz of this Question
Recommended Posts:
- GATE | Gate IT 2008 | Question 27
- GATE | Gate IT 2008 | Question 13
- GATE | Gate IT 2008 | Question 12
- GATE | Gate IT 2008 | Question 11
- GATE | Gate IT 2008 | Question 10
- GATE | Gate IT 2008 | Question 9
- GATE | Gate IT 2008 | Question 8
- GATE | Gate IT 2008 | Question 7
- GATE | Gate IT 2008 | Question 6
- GATE | Gate IT 2008 | Question 5
- GATE | Gate IT 2008 | Question 4
- GATE | Gate IT 2008 | Question 3
- GATE | Gate IT 2008 | Question 2
- GATE | Gate IT 2008 | Question 1
- GATE | Gate IT 2008 | Question 14
Improved By : LokeshJain



