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 21–25 of 65

Q21Graph Theory1 markNAT
Consider the following directed graph:
a b c d e f
The number of different topological orderings of the vertices of the graph is

Q22Function1 markMCQ−0.33 if wrong
Consider the following C program.
 void f(int,short);
void main()
{
int i=100;
short s=12;
short *p=&s;
__________ ;//calltof()
} 
Which one of the following expressions, when placed in the blank above, will NOT result in a typec hecking error?

Q23Sorting1 markMCQ−0.33 if wrong
The worst case running times of Insertion sort, Mergesort and Quicksort, respectively, are:

Q24Minimum Spanning Tree1 markMCQ−0.33 if wrong
Let G be a weighted connected undirected graph with distinct positive edge weights. If every edge weight is increasedby the same value ,then which of the following statements is/are TRUE?
P: Minimum spanning tree of G does not change
Q: Shortest path between any pair of vertices does not change

Q25Array and Pointer1 markNAT
Consider the following C program.

#include <stdio.h>
void mystery(int *ptra,int *ptrb){
   int *temp;
   temp =ptrb; 
   ptrb =ptra;
   ptra =temp;
}
int main(){
   int a=2016,b=0,c=4,d=42;
   mystery(&a, &b);
   if (a < c)
            mystery(&c, &a);
   mystery(&a, &d);
   printf("%d\n", a);
}
The output of the program is _________.