GATE 2019 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2019

65 questions

MCQ 41 · NAT 241-mark 30 · 2-mark 35

Questions 26–30 of 65

Q26Application Layer Protocols1 markMCQ−0.33 if wrong
Which of the following protocol pairs can be used to send and retrieve e-mails (in that order)?

Q27System Call1 markNAT
The following C program is executed on a Unix / Linux system:
#include <unistd.h>
  int main() {
    int i;
    for (i = 0; i < 10; i++)
      if (i % 2 == 0) fork();
    return 0;
  }
The total number of child process created is __________ .

Q28Function1 markNAT
Consider the following C program:
 
#include <stdio.h>
  int jumble(int x, int y) {
    x = 2 * x + y;
    return x;
  }
int main() {
  int x = 2, y = 5;
  y = jumble(y, x);
  x = jumble(y, x);
  printf("%d\n", x);
  return 0;
}
The value printed by program is __________ .

Q29Parsing1 markNAT
Consider the following given grammar:
 
S -> Aa
A -> BD
B -> b| ε
D -> d| ε 
Let a, b, d and $ be indexed as follows:
a b d $ 3 2 1 0
Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a, b, d, $}, then the answer should be 3210).
Answer:_____

Q30Sorting1 markNAT
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is _________.