1
GATE CSE 2024 Set 1
MCQ (Single Correct Answer)
+1
-0.33

Given an integer array of size $N$, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The worst-case time complexity of this algorithm is

A

both $O(N)$ and $\Omega(N)$

B

$O(N)$ but not $\Omega(N)$

C

$\Omega(N)$ but not $O(N)$

D

neither $O(N)$ nor $\Omega(N)$

2
GATE CSE 2024 Set 1
MCQ (Single Correct Answer)
+2
-0.66

Consider the following recurrence relation:

$$T(n) = \begin{cases} \sqrt{n} T(\sqrt{n}) + n & \text{for } n \ge 1, \\ 1 & \text{for } n = 1. \end{cases}$$

Which one of the following options is CORRECT?

A

$$T(n) = \Theta(n \log \log n)$$

B

$$T(n) = \Theta(n \log n)$$

C

$$T(n) = \Theta(n^2 \log n)$$

D

$$T(n) = \Theta(n^2 \log \log n)$$

3
GATE CSE 2024 Set 1
MCQ (More than One Correct Answer)
+1
-0.33

Which of the following is/are Bottom-Up Parser(s)?

A

Shift-reduce Parser

B

Predictive Parser

C

LL(1) Parser

D

LR Parser

4
GATE CSE 2024 Set 1
MCQ (Single Correct Answer)
+2
-0.66

Consider the following syntax-directed definition (SDD).

S → DHTU { S.val = D.val + H.val + T.val + U.val; }
D → “M” D1 { D.val = 5 + D1.val; }
D → ε { D.val = –5; }
H → “L” H1 { H.val = 5 * 10 + H1.val; }
H → ε { H.val = –10; }
T → “C” T1 { T.val = 5 * 100 + T1.val; }
T → ε { T.val = –5; }
U → “K” { U.val = 5; }
Given “MMLK” as the input, which one of the following options is the CORRECT value computed by the SDD (in the attribute S.val)?
A

45

B

50

C

55

D

65

EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12