1
GATE CSE 2026 Set 1
Numerical
+2
-0
Consider the recursive functions represented by the following code segment:

int bar(int n){

    if (n == 1) return 0;

    else return 1 + bar(n/2);

}

int foo(int n){

    if (n == 1) return 1;

    else return 1 + foo(bar(n));

}

The smallest positive integer n for which foo(n) returns 5 is $\_\_\_\_$ . (answer in integer)

Note: Ignore syntax errors (if any) in the function.

Your input ____
2
GATE CSE 2026 Set 1
MCQ (More than One Correct Answer)
+1
-0

Consider the following grammar where $S$ is the start symbol, and $a$ and $b$ are terminal symbols.

$$ S \rightarrow a S b S|b S| \in $$

Which of the following statements is/are true?

A

The grammar is ambiguous.

B

The string $a b b$ has two distinct derivations in this grammar.

C

The string $a b a b$ has only one rightmost derivation.

D

The language generated by the grammar is undecidable.

3
GATE CSE 2026 Set 1
MCQ (More than One Correct Answer)
+1
-0

Let $M$ be a non-deterministic finite automaton (NFA) with 6 states over a finite alphabet. Which of the following options CANNOT be the number of states in the minimal deterministic finite automaton (DFA) that is equivalent to $M$ ?

A

32

B

65

C

1

D

128

4
GATE CSE 2026 Set 1
MCQ (Single Correct Answer)
+2
-0

Let $L_1$ and $L_2$ be two languages over a finite alphabet, such that $L_1 \cap L_2$ and $L_2$ are regular languages.

Which of the following statements is/are always true?

A

$L_1$ is regular

B

$L_1 \cup L_2$ is regular

C

$\overline{L_2}$ is context free

D

$L_1$ is context free