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

GATE 2020

64 questions

MCQ 41 · NAT 231-mark 29 · 2-mark 35

Questions 31–35 of 64

Q32Array and Pointer1 markNAT
Consider the following C program.
    #include <stdio.h>
    int main ()  {
        int  a[4] [5] = {{1, 2, 3, 4, 5},
                        {6, 7,8, 9, 10},
                        {11, 12, 13, 14, 15},
                        {16, 17,18, 19, 20}};
        printf("%d\n", *(*(a+**a+2)+3));
        return(0);
    }
The output of the program is _______.

Q33Hashing1 markNAT
Consider a double hashing scheme in which the primary hash function is h1(k)=k  mod  23h_1(k)=k\; mod \; 23, and the secondary hash function is h2(k)=1+(k  mod  19)h_2(k)=1+(k\; mod \; 19). Assume that the table size is 23. Then the address returned by probe 1 in the probe sequence (assume that the probe sequence begins at probe 0) for key value k=90 is_____________.

Q34Parsing1 markNAT
Consider the following grammar.

S→aSB∣dS\rightarrow aSB|d
B→bB\rightarrow b

The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbbaaadbbb is___________.

Q35Application Layer Protocols1 markNAT
Assume that you have made a request for a web page through your web browser to a web server. Initially the browser cache is empty. Further, the browser is configured to send HTTP requests in non-persistent mode. The web page contains text and five very small images.The minimum number of TCP connections required to display the web page completely in your browser is__________.

Q36Turing Machine2 marksMCQ−0.67 if wrong
Which of the following languages are undecidable? Note that ⟨M⟩\left \langle M \right \rangle indicates encoding of the Turing machine MM.

L1={⟨M⟩∣L(M)=∅}L_1=\{\left \langle M \right \rangle|L(M)=\varnothing \}
L2=L_2={⟨M,w,q⟩∣M\left \langle M,w,q \right \rangle|M on input w reaches state q in exactly 100 steps}
L3={⟨M⟩∣L(M)  is  not  recursive}L_3=\{\left \langle M \right \rangle|L(M) \;is \; not \; recursive\}
L4={⟨M⟩∣L(M)  contains  at  least  21  members}L_4=\{\left \langle M \right \rangle|L(M) \;contains \; at \; least\; 21 \; members\}