GATE 2016 (Session 1) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2016 (Session 1)

65 questions

MCQ 39 · NAT 261-mark 30 · 2-mark 35

Questions 46–50 of 65

Q46Function2 marksMCQ−0.67 if wrong
What will be the output of the following pseudo-code when parameters are passed by reference and dynamic scoping is assumed?

a=3;
void n(x){x=x*a;  print(x);}
void m(y){a=1;a=y-a;n(a);print(a);}
void main(){m(a);}

Q47Heap Tree2 marksMCQ−0.67 if wrong
An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node.Assume that the heap is implemented in an array and i refers to the i-th index of thearray.If the heap tree has depth d (number of edges on the path from the root to the farthest leaf),the n what is the time complexity to re-fix the heap efficiently after the removal of the element?

Q48Shortest Path2 marksNAT
Consider the weighted undirected graph with 4 vertices,where the weigh to edge {i, j} is given by the entry Wij in the matrix W.
W=[02852058850x58x0]W=\begin{bmatrix} 0 & 2&8 & 5\\ 2& 0& 5 &8 \\ 8 & 5 & 0& x\\ 5&8 & x&0 \end{bmatrix}
The largest possible integer value of x, for which at least one shortest path between some pair of vertices will contain the edge with weight x is ____.

Q49Minimum Spanning Tree2 marksNAT
Let G be a complete undirected graph on 4 vertices, having 6 edges with weights being 1,2,3,4,5, and 6. The maximum possible weight that a minimum weight spanning tree of G can haveis .

Q50Minimum Spanning Tree2 marksMCQ−0.67 if wrong
G = (V,E) is an undirected simple graph in which each edge has a distinct weight,and e is a particular edgeof G. Which of the following statements about the minimum spanning trees (MSTs) of G is/are TRUE?
I. If e is the lightest edge of some cycle in G, then every MST of G includes e
II. If e is the heaviest edge of some cycle in G, then every MST of G excludes e