1
GATE CSE 2021 Set 1
MCQ (Single Correct Answer)
+2
-0.67

Consider the following recurrence relation.

$$T(n) = \left\{ {\begin{array}{*{20}{c}} {T(n/2) + T(2n/5) + 7n \ \ \ if\ n > 0}\\ {1\ \ \ \ \ \ \ if\ n = 0} \end{array}} \right.$$

Which one of the following option is correct?

A
T(n) = Θ(n log n)
B
T(n) = Θ(n5/2)
C
T(n) = Θ((log n)5/2)
D
T(n) = Θ(n)
2
GATE CSE 2021 Set 1
MCQ (Single Correct Answer)
+2
-0.67

Let G = (V, E) be an undirected unweighted connected graph. The diameter of G is defined as:

diam(G) = $$\displaystyle\max_{u, x\in V}$$ {the length of shortest path between u and v}

Let M be the adjacency matrix of G.

Define graph G2 on the same set of vertices with adjacency matrix N, where

$$N_{ij} =\left\{ {\begin{array}{*{20}{c}} {1 \ \ \text{if} \ \ {M_{ij}} > 0 \ \ \text{or} \ \ P_{ij} > 0, \ \text{where} \ \ P = {M^2}}\\ {0, \ \ \ \ \ \text{otherwise}} \end{array}} \right.$$

Which one of the following statements is true?

A
diam(G) < diam(G2) ≤ diam(G)
B
$$\left\lceil {diam(G)/2} \right\rceil $$ < diam(G2) < diam(G)
C
diam(G2) ≤ $$\left\lceil {diam(G)/2} \right\rceil $$
D
diam(G2) = diam(G)
3
GATE CSE 2021 Set 1
MCQ (Single Correct Answer)
+2
-0.67

Consider the following statements.

S1 : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1).

S2 : For any context-free grammar, there is a parser that takes at most O(n3) time to parse a string of length n.

Which one of the following option is correct?

A
S1 is true and S2 is false
B
S1 is false and S2 is true
C
S1 is true and S2 is true
D
S1 is false and S2 is false
4
GATE CSE 2021 Set 1
MCQ (Single Correct Answer)
+2
-0.67

Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code:

P → D* E*

D → int ID {record that ID.lexeme is of type int}

D → bool ID { record that ID.lexeme is of type bool}

E → E1 + E2 {check that E1.type = E2.type = int; set E.type := int}

E → !E1 {check that E1.type = bool; set E.type := bool}

E → ID {set E.type := int}

With respect to the above grammar; which one of the following choices is correct?

A
The actions will lead to infinite loop.
B
The actions can be used to correctly type-check any syntactically correct program.
C
The actions can be used to type-check syntactically correct boolean variable declarations and boolean expressions.
D
The actions can be used to type-check syntactically correct integer variable declarations and integer expressions.
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12