GATE 2008 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2008

185 questions

MCQ 1851-mark 52 · 2-mark 133

Questions 91–95 of 185

Q91Binary Search Tree2 marksMCQ−0.67 if wrong
How many distinct BSTs can be constructed with 3 distinct keys?

Q92Binary Search Tree2 marksMCQ−0.67 if wrong
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?

Q93Binary Search Tree2 marksMCQ−0.67 if wrong
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?

Q94Binary Search Tree1 markMCQ−0.33 if wrong
Which of the following is TRUE?

Q95Binary Search Tree2 marksMCQ−0.67 if wrong
You are given the postorder traversal, P, of a binary search tree on the n elements 1, 2,...,n. You have to determine the unique binary search tree that has P as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this?