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

GATE 2006

191 questions

MCQ 1911-mark 191

Questions 111–115 of 191

Q111Sorting1 markMCQ−0.33 if wrong
Which one the following in place sorting algorithms needs the minimum number of swaps?

Q112Asymptotic Notation1 markMCQ−0.33 if wrong
Consider the following C-program fragment in which i, j,and n are integer variables.
for (i = n, j = 0; i > 0; i/=2, j += i);
Let Val(j) denote the value stored in the variable j after termination of the for loop. Which one of the following is true?

Q113Recurrence Relation1 markMCQ−0.33 if wrong
Consider the following recurrence:
T(n)=2T(⌈n⌉\left \lceil \sqrt{n} \right \rceil)+ 1, T(1) = 1
Which one of the following is true?

Q114Greedy Technique1 markMCQ−0.33 if wrong
The characters a to h have the set of frequencies based on the first 8 Fibonacci numbers as follows
a:1, b:1, c:2, d:3, e:5, f:8, g:13, h:21
A Huffman code is used to represent the characters. What is the sequence of characters corresponding to the following code?
110111100111010

Q115Graph Traversal (BFS and DFS)1 markMCQ−0.33 if wrong
Consider the depth-first-search of an undirected graph with 3 vertices P, Q, and R. Let discovery time d(u) represent the time instant when the vertex u is first visited, and finish time f(u) represent the time instant when the vertex u is last visited. Given that
d(P)=5 units  f(P)=12 units d(Q)=6 units f(Q)=10 unitsd(R)=14 unitf(R)=18 units\begin{array}{l|l}\hline \text{$d(P) = 5$ units } & \text{ $f(P) = 12$ units } \\\hline \text{$d(Q) = 6$ units} & \text{ $f(Q) = 10$ units} \\\hline \text{$d(R) = 14$ unit} & \text{$f(R) = 18$ units} \\\hline \end{array}
Which one of the following statements is TRUE about the graph?