• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE-CS-2017 (Set 2)

Question 31

Which of the following statements about the parser is/are correct?
I. Canonical LR is more powerful than SLR.
II. SLR is more powerful than LALR.
III. SLR is more powerful than canonical LR.
  • I only
  • II only
  • III only
  • II and III only

Question 32

Consider a quadratic equation x2 - 13x + 36 = 0 with coefficients in a base b. The solutions of this equation in the same base b are x = 5 and x = 6. Then b = ______.
Note: This question appeared as Numerical Answer Type in GATE.
  • 6
  • 7
  • 8
  • 9

Question 33

g2017_7 The minimum number of ordered pairs that need to be added to R to make (X, R) a lattice is _____.
Note: This question appeared as Numerical Answer Type.
  • 0
  • 1
  • 2
  • 3

Question 34

Which of the following is/are shared by all the threads in a process?
I. Program Counter

II. Stack

III. Address space

IV. Registers
  • I and II only
  • III only
  • IV only
  • III and IV only

Question 35

Consider the following function implemented in C:
void printxy(int x, int y)
{
    int *ptr;
    x = 0;
    ptr = &x;
    y = *ptr;
    *ptr = 1;
    printf("%d,%d", x, y);
}


The output of the printxy(1,1) is
  • 0,0
  • 0,1
  • 1,0
  • 1,1

Question 36

A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for 3 processes are shown below: g2017_8 Which of the following best describes the current state of the system?
  • Safe, Deadlocked
  • Safe, Not Deadlocked
  • Not Safe, Deadlocked
  • Not Safe, Not Deadlocked

Question 37

The read access times and the hit ratios for different caches in a memory hierarchy are as given below: g2017_9 The read access time of main memory in 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the writeback policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% od memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is _________
Note: This question appeared as Numerical Answer Type.
  • 2.74
  • 4.72
  • 3.10
  • 2.67

Question 38

Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variable x, y, q and r are all unsigned int.
while(r >= y)
{
r = r - y;
q = q + 1;
}
Which of the following conditions on the variables x, y, q and r before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
  • ( q == r ) && ( r == 0)
  • ( x > 0 ) && ( r == x ) && ( y > 0 )
  • ( q == 0 ) && ( r == x ) && ( y > 0 )
  • ( q == 0 ) && ( y > 0 )

Question 39

Let δ denote the transition function and α denoted the extended transition function of the ε-NFA whose transition table is given below: g2017_10 Then, α (q2,aba) is
  • Ø
  • {q1, q2, q3}
  • {q0, q1, q2}
  • {q0, q2, q3}

Question 40

Consider the following expression grammar G.
E -> E - T | T
T -> T + F | F
F -> (E) | id
Which of the following grammars are not left recursive, but equivalent to G.
A)
E -> E - T | T
T -> T + F | F
F -> (E) | id

B)
E -> TE\'
E\' -> -TE\' | ε
T -> T + F | F
F -> (E) | id

C)
E -> TX
X -> -TX | ε
T -> FY
Y -> +FY | ε
F -> (E) | id

D)
E -> TX | (TX)
X -> -TX | +TX | ε
T -> id
  • A
  • B
  • C
  • D

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion