GATE | GATE IT 2006 | Question 45

Suppose that we have numbers between 1 and 100 in a binary search tree and want to search for the number 55. Which of the following sequences CANNOT be the sequence of nodes examined?
(A) {10, 75, 64, 43, 60, 57, 55}
(B) {90, 12, 68, 34, 62, 45, 55}
(C) {9, 85, 47, 68, 43, 57, 55}
(D) {79, 14, 72, 56, 16, 53, 55}


Answer: (C)

Explanation: In BST on right side of parent number should be greater than it, but in C after 47, 43 appears that is wrong.

Quiz of this Question
Please comment below if you find anything wrong in the above post



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.