• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE-CS-2015 (Set 1)

Question 11

Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n(≥ 2) numbers? In the recurrence equations given in the options below, c is a constant.

  • T(n) = 2T (n/2) + cn

  • T(n) = T(n – 1) + T(0) + cn

  • T(n) = 2T (n – 2) + cn

  • T(n) = T(n/2) + cn

Question 12

For any two languages L1 and L2 such that L1 is context free and L2 is recursively enumerable but not recursive, which of the following is/are necessarily true?
1. L1\' (complement of L1) is recursive 
2. L2\' (complement of L2) is recursive
3. L1\' is context-free 
4. L1\' ∪ L2 is recursively enumerable 
  • 1 only
  • 3 only
  • 3 and 4 only
  • 1 and 4 only

Question 13

[Tex] \\\\ \\lim_{x\\to \\infty } x^{\\frac{1}{x}} is [/Tex]
  • 0
  • 1
  • Not Defined

Question 14

Q15
  • a
  • b
  • c
  • d

Question 15

Match the following

List-I
A. Prim’s algorithm for minimum spanning tree
B. Floyd-Warshall algorithm for all pairs shortest paths
C. Mergesort
D. Hamiltonian circuit
List-II
1. Backtracking
2. Greedy method
3. Dynamic programming
4. Divide and conquer
Codes:
    A B C D
(a) 3 2 4 1
(b) 1 2 4 3
(c) 2 3 4 1
(d) 2 1 3 4 
  • a

  • b

  • c

  • d

Question 16

For computers based on three-address instruction formats, each address field can be used to specify which of the following:
S1: A memory operand
S2: A processor register
S3: An implied accumulator register
  • Either S1 or S2
  • Either S2 or S3
  • Only S2 and S3
  • All of S1, S2 and S3

Question 17

The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.
P1() 
{ 
   C = B – 1; 
   B = 2*C;  
}

P2()
{
   D = 2 * B;
   B = D - 1; 
}
The number of distinct values that B can possibly take after the execution is
  • 3
  • 2
  • 5
  • 4

Question 18

Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)?
1. 3, 5, 7, 8, 15, 19, 25
2. 5, 8, 9, 12, 10, 15, 25
3. 2, 7, 10, 8, 14, 16, 20
4. 4, 6, 7, 9, 18, 20, 25 
  • 1 and 4 only
  • 2 and 3 only
  • 2 and 4 only
  • 2 only

Question 19

The output of the following C program is __________. C
void f1 (int a, int b)
{
  int c;
  c=a; a=b; b=c;
}
void f2 (int *a, int *b)
{
  int c;
  c=*a; *a=*b;*b=c;
}
int main()
{
  int a=4, b=5, c=6;
  f1(a, b);
  f2(&b, &c);
  printf (%d, c-a-b);
  return 0;
}
  • -5
  • -4
  • 5
  • 3

Question 20

Consider a system with byte-addressable memory, 32 bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ___________
  • 2
  • 4
  • 8
  • 16

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion