GATE | Gate IT 2008 | Question 69
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
Suppose the BST has been unsuccessfully searched for key 273. Which all of the above sequences list nodes in the order in which we could have encountered them in the search?
(A) II and III only
(B) I and III only
(C) III and IV only
(D) III only
Answer: (D)
Explanation: Key to be searched 273:
- I) 81, 537, 102, 439, 285, 376, 305 is not correct
We cannot go to 376 from 285 as 273 is smaller than 285. - II) 52, 97, 121, 195, 242, 381, 472 is not correct.
We cannot go to 472 from 381 as 273 is smaller than 381. - III) 142, 248, 520, 386, 345, 270, 307 is correct

- 550, 149, 507, 395, 463, 402, 270 is not correct.
We cannot go to 463 from 395 in search of 273
Recommended Posts:
- GATE | Gate IT 2008 | Question 77
- GATE | Gate IT 2008 | Question 78
- GATE | Gate IT 2008 | Question 79
- GATE | Gate IT 2008 | Question 80
- GATE | Gate IT 2008 | Question 81
- GATE | Gate IT 2008 | Question 82
- GATE | GATE CS 2008 | Question 15
- GATE | GATE CS 2008 | Question 80
- GATE | Gate IT 2008 | Question 76
- GATE | Gate IT 2008 | Question 75
- GATE | Gate IT 2008 | Question 74
- GATE | Gate IT 2008 | Question 65
- GATE | Gate IT 2008 | Question 66
- GATE | Gate IT 2008 | Question 67
- GATE | Gate IT 2008 | Question 68



