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

GATE 2011

81 questions

MCQ 811-mark 40 · 2-mark 41

Questions 31–35 of 81

Q31Asymptotic Notation2 marksMCQ−0.67 if wrong
Which of the given options provides the increasing order of asymptotic complexityoffunctions f1, f2, f3 and f4?

f1(n)=2n;f_{1}(n)=2^{n};
f2(n)=n3/2;f_{2}(n)=n^{3/2};
f3(n)=nlog2n;f_{3}(n)=nlog_{2}n;
f4(n)=nlog2nf_{4}(n)=n^{log_{2}n}

Q32Dynamic Programming2 marksMCQ−0.67 if wrong
Four matrices M1, M2, M3 and M4 are dimensions p x q, q x r, r x s and s x t respectively can be multiplied in several ways with different number of total scalar multiplications. For example When multiplied as ((M1×M2)×(M3×M4)((M_{1} \times M_{2})\times (M_{3}\times M_{4}) the total number of scalar multiplications is pqr+rst+prt. When multiplied as (((M1×M2)×M3)×M4)(((M_{1}\times M_{2})\times M_{3})\times M_{4}) , the total number of scalar multiplications is pqr+prs+pst. If p=10, q=100, r=20, s=5 and t=80, then the minimum number of scalar multiplications needed is

Q33Dynamic Programming1 markMCQ−0.33 if wrong
An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0 :n-1] is given below.
Let Li denote the length of the longest monotonically increasing sequence starting at index i in the array

Initialize Ln−1=1L_{n-1}=1.
For all ii such that 0≤i≤n−20\le i\le n-2
Li={1+Li+1if A[i]<A[i+1]1OtherwiseL_i=\begin{cases}1+L_{i+1} & \text{if } A[i]\lt A[i+1]\\ 1 & \text{Otherwise}\end{cases}
Finally the length of the longest monotonically increasing sequence is Max(L0,L1,…,Ln−1)\text{Max}\left(L_0, L_1, \ldots, L_{n-1}\right).
Which of the following statements is TRUE?

Q34Minimum Spanning Tree2 marksMCQ−0.67 if wrong
An undirected graph G(V, E) contains n (n>\gt2) nodes named v1 , v2 ,...,vn. Two nodes vi , vj are connected if and only if 0<\lt|i-j|≤\leq2. Each edge (vi,vj ) is assigned a weight i+j. A sample graph with n=4 is shown below.
V3 V4 V1 V2 7 4 5 6 3
The length of the path from v5 to v6 in the MST of previous question with n = 10 is

Q35Minimum Spanning Tree2 marksMCQ−0.67 if wrong
An undirected graph G(V, E) contains n (n>>2) nodes named v1 , v2 ,...,vn. Two nodes vi , vj are connected if and only if 0<\lt|i-j|≤\leq2. Each edge (vi,vj ) is assigned a weight i+j. A sample graph with n=4 is shown below.
V3 V4 V1 V2 7 4 5 6 3
What will be the cost of the minimum spanning tree (MST) of such a graph with n nodes?