• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE-CS-2016 (Set 1)

Question 21

Consider the following directed graph. \"GATECS20167\" The number of different topological orderings of the vertices of the graph is   Note : This question was asked as Numerical Answer Type.

  • 1

  • 2

  • 4

  • 6

Question 22

Consider the following C program. C
void f(int, short);
void main()
{
  int i = 100;
  short s = 12;
  short *p = &s;
  __________ ;   // call to f()
}
Which one of the following expressions, when placed in the blank above, will NOT result in a type checking error?
  • f(s, *s)
  • i = f(i,s)
  • f(i,*s)
  • f(i,*p)

Question 23

The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:

  • Θ(n log n), Θ(n log n) and Θ(n2)

  • Θ(n2), Θ(n2) and Θ(n Log n)

  • Θ(n2), Θ(n log n) and Θ(n log n)

  • Θ(n2), Θ(n log n) and Θ(n2)

Question 24

Given the intervals [(1, 4), (3, 6), (5, 7), (8, 9)], what would be the output of calling a function that solves the Job Scheduling Algorithm?

  • [(1, 4), (5, 7), (8, 9)]

  •  [(1, 4), (3, 6), (8, 9)]

  •  [(1, 4), (3, 6)]

  •  [(1, 4), (3, 6), (5, 7)]

Question 25

Consider the following C program. 

C
#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", a);
}

The output of the program _____________   Note : This question was asked as Numerical Answer Type.

  • 2016

  • 0

  • 4

  • 8

Question 26

Which of the following languages is generated by the given grammar? S → aS|bS| ε
  • {anbm | m,n >= 0}
  • {w∈{a,b}* | w has equal number of a\'s and b\'s}
  • {an | n>=0} U {anbn \\ n>=0}
  • {a,b}*

Question 27

Which of the following decision problems are undecidable
  • I and IV only
  • II and III only
  • III and IV only
  • II and IV only

Question 28

Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s? gatecs201611
  • A
  • B
  • C
  • D

Question 29

Consider the following code segment.
x = u - t;
y = x * v;
x = y + w;
y = t - z;
y = x * y; 
The minimum number of total variables required to convert the above code segment to static single assignment form is   Note : This question was asked as Numerical Answer Type.
  • 6
  • 8
  • 9
  • 10

Question 30

Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?

  • Shortest remaining time first

  • Round-robin with time quantum less than the shortest CPU burst

  • Uniform random

  • Highest priority first with priority proportional to CPU burst length

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion