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

GATE 2009

66 questions

MCQ 661-mark 24 · 2-mark 42

Questions 31–35 of 66

Q31B plus Tree2 marksMCQ−0.67 if wrong
The following key values are inserted into a B+ tree in which order of the internal nodes is 3, and that of the leaf nodes is 2, in the sequence given below. The order of internal nodes is the maximum number of tree pointers in each node, and the order of leaf nodes is the maximum number of data items that can be stored in it. The B+ - tree is initially empty.

10, 3, 6, 8, 4, 2, 1

The maximum number of times leaf nodes would get split up as a result of these insertions is

Q32Hashing2 marksMCQ−0.67 if wrong
The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table?
(A) 0 1 2 2 3 23 4 5 15 6 7 8 18 9 (B) 0 1 2 12 3 13 4 5 5 6 7 8 18 9 (C) 0 1 2 12 3 13 4 2 5 3 6 23 7 5 8 18 9 15 (D) 0 1 2 12,2 3 13,3,23 4 5 5,15 6 7 8 18 9

Q33Sorting2 marksMCQ−0.67 if wrong
In quick sort, for sorting n elements, the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case time complexity of the quick sort?

Q34Sorting1 markMCQ−0.33 if wrong
What is the number of swaps required to sort n elements using selection sort, in the worst case?

Q35Recurrence Relation2 marksMCQ−0.67 if wrong
The running time of an algorithm is represented by the following recurrence relation:
T(n)={nn≤3T(n3)+cnotherwiseT(n)=\left\{\begin{matrix} n & n\leq 3\\ T(\frac{n}{3})+cn& otherwise \end{matrix}\right.
Which one of the following represents the time complexity of the algorithm?