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

GATE 2003

107 questions

MCQ 1071-mark 107

Questions 61–65 of 107

Q61Binary Search Tree1 markMCQ−0.33 if wrong
Let T(n) be the number of different binary search trees on n distinct elements.
Then T(n)=∑k=1nT(k−1)T(x)T(n)=\sum_{k=1}^{n}T(k-1)T(x),
where xx is

Q62Heap Tree1 markMCQ−0.33 if wrong
A data structure is required for storing a set of integers such that each of the following operations can be done in O(logn) time, where n is the number of elements in the set.

1. Delection of the smallest element.
2. Insertion of an element if it is not already present in the set.

Which of the following data structures can be used for this purpose ?

Q63Heap Tree1 markMCQ−0.33 if wrong
In a heap with n elements with the smallest element at the root, the 7th7^{th} smallest element can be found in time

Q64B Tree1 markMCQ−0.33 if wrong
Consider the following 2-3-4 tree (i.e., B-tree with a minimum degree of two) in which each data item is a letter. The usual alphabetical ordering of letters is used in constructing the tree
L P U B H I N Q T V X Z
What is the result of inserting G in the above tree ?
(A) (B) (C) P G L U B H I N Q T V X Z P H L U B G I N Q T V X Z I P U B G H L N Q T V X Z

Q65Sorting1 markMCQ−0.33 if wrong
In a permutation a1.....ana_1.....a_n of n distinct integers, an inversion is a pair (ai,aj)(a_i, a_j) such that i<ji \lt j and ai>aja_i \gt a_j.

What would be the worst case time complexity of the insertion Sort algorithm, if the inputs are restricted to permutations of 1....n with at most n inversions?