• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CS 2021 | Set 2

Question 11

Let H be a binary min-heap consisting of n elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in H?

  • Θ(1)

  • Θ(logn)

  • Θ(n)

  • Θ(nlogn)

Question 12

Consider the following ANSI C program: 
 

int main () {
    Integer x;
    return 0;
}


Which one of the following phases in a seven-phase C compiler will throw an error?
 

  • Lexical analyzer
     

  • Syntax analyzer
     

  • Semantic analyzer
     

  • Machine dependent optimizer
     

Question 13

The format of the single-precision floating point representation of a real number as per the IEEE 754 standard is as follows: Which one of the following choices is correct with respect to the smallest normalized positive number represented using the standard?
  • exponent =00000000 and mantissa =0000000000000000000000000
  • exponent =00000000 and mantissa =0000000000000000000000001
  • exponent =00000001 and mantissa =0000000000000000000000000
  • exponent =00000001 and mantissa =0000000000000000000000001

Question 14

Which one of the following circuits implements the Boolean function given below?
f(x,y,z) = m0 + m1 + m3 + m4 + m5 + m6 
where mi is the ith minterm.
  • A
  • B
  • C
  • D

Question 15

Consider the following statements S1 and S2 about the relational data model:
  • S1: A relation scheme can have at most one foreign key.
  • S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.
Which one of the following choices is correct?
  • Both S1 and S2 are true
  • S1 is true and S2 is false
  • S1 is false and S2 is true
  • Both S1 and S2 are false

Question 16

Consider the three-way handshake mechanism followed during TCP connection establishment between hosts P and Q. Let X and Y be two random 32-bit starting sequence numbers chosen by P and Q respectively. Suppose P sends a TCP connection request message to Q with a TCP segment having SYN bit =1, SEQ number =X, and ACK bit =0. Suppose Q accepts the connection request. Which one of the following choices represents the information present in the TCP segment header that is sent by Q to P?
  • SYN bit =1, SEQ number =X+1, ACK bit =0, ACK number =Y, FIN bit =0
  • SYN bit =0, SEQ number =X+1, ACK bit =0, ACK number =Y, FIN bit =1
  • SYN bit =1, SEQ number =Y, ACK bit =1, ACK number =X+1, FIN bit =0
  • SYN bit =1, SEQ number =Y, ACK bit =1, ACK number =X, FIN bit =0

Question 17

Let L⊆{0,1}∗ be an arbitrary regular language accepted by a minimal DFA with k states. Which one of the following languages must necessarily be accepted by a minimal DFA with k states?
  • L−{01}
  • L∪{01}
  • {0,1}*–L
  • L⋅L

Question 18

Consider the following ANSI C program.
#include < stdio.h >
int main( ) 
{
    int arr[4][5];
    int  i, j;
    for (i=0; i<4; i++) 
    ??????{
        for (j=0; j<5; j++) 
        {
            arr[i][j] = 10 * i + j;
        }
    }
    printf("%d", *(arr[1]+9));
    return 0;
} 
What is the output of the above program?
  • 14
  • 20
  • 24
  • 30

Question 19

Consider the following sets, where n≥2:
  • S1: Set of all n×n matrices with entries from the set {a,b,c}
  • S2: Set of all functions from the set {0,1,2 ... ,n2−1} to the set {0,1,2}
Which of the following choice(s) is/are correct?
  • There does not exist a bijection from S1 to S2
  • There exists a surjection from S1 to S2
  • There exists a bijection from S1 to S2
  • There does not exist an injection from S1 to S2

Question 20

Let L1 be a regular language and L2 be a context-free language. Which of the following languages is/are context-free?
  • L1∩L2\'
  • (L1\'∪L2\')\'
  • L1∪(L2∪L2\')
  • (L1∩L2)∪(L1∩L2)

There are 65 questions to complete.

Last Updated :
Take a part in the ongoing discussion