GATE 2021 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2021 (Session 2)

64 questions

MCQ 33 · MSQ 13 · NAT 181-mark 29 · 2-mark 35

Questions 56–60 of 64

Q57Regular Expression2 marksMSQ
Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string ϵ\epsilon is divisible by three.

One or more options are correct.

Q58Memory Management2 marksNAT
Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below:
39-bit virtual address Level 1offset Level 2offset Level 3offset Pageoffset 9 bits9 bits9 bits12 bits
The page size is 4 KB = (1KB =2102^{10} bytes) and page table entry size at every level is 8 bytes. A process P is currently using 2 GB (1 GB =2302^{30} bytes) virtual memory which is mapped to 2 GB of physical memory. The minimum amount of memory required for the page table of P across all levels is _________ KB

Q59Function2 marksNAT
Consider the following ANSI C program
 #include <stdio.h>
int foo(int x, int y, int q) 
    {
        if ((x <= 0) && (y <= 0))
        return q;
        if (x <= 0)
        return foo(x, y-q, q);
        if (y <= 0)
        return foo(x-q, y, q);
        return foo(x, y-q, q) + foo(x-q, y, q);
    }
int main( )
{
    int r = foo(15, 15, 10);
    printf("%d", r);
    return 0;
}
The output of the program upon execution is ____

Q60Set Theory2 marksNAT
Let S be a set of consisting of 10 elements. The number of tuples of the form (A,B) such that A and B are subsets of S, and A⊆BA\subseteq B is _______

Q61Parsing2 marksNAT
Consider the following augmented grammar with {#,@,<,>,a,b,c}\{ \#, @, <, >, a, b, c \} as the set of terminals.

S′→SS→S#cSS→SSS→S@S→<S>S→aS→bS→c\begin{array}{l} S' \rightarrow S \\ S \rightarrow S \# cS \\ S \rightarrow SS \\ S \rightarrow S @ \\ S \rightarrow < S > \\ S \rightarrow a \\ S \rightarrow b \\ S \rightarrow c \end{array}

Let I0=CLOSURE({S′→∙S})I_0 = \text{CLOSURE}(\{S' \rightarrow \bullet S\}). The number of items in the set GOTO(GOTO(I0<),<)\text{GOTO(GOTO}(I_0 \lt ), \lt ) is ___________