Thursday 2 July 2015

Q36,p3,D14. Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?



(A) 4, 254, 403, 400, 332, 346, 399, 365
(B) 926, 222, 913, 246, 900, 260, 364, 365
(C) 927, 204,913, 242, 914, 247, 365
(D) 4, 401, 389, 221, 268, 384, 383, 280, 365
Answer C.
914 is the left descendent of 913 . hence it should be less than 913.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.