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

Let $G(V, E)$ be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the number of edges in that path.

Let $s \in V$ be a vertex in $G$. For every $u \in V$ and for every $k \geq 0$, let $d_k(u)$ denote the weight of a shortest path (in terms of weight) from $s$ to $u$ of length at most $k$. If there is no path from $s$ to $u$ of length at most $k$, then $d_k(u)=\infty$.

Consider the statements:

S1: For every $k \geq 0$ and $u \in V, d_{k+1}(u) \leq d_k(u)$.

S2: For every $(u, v) \in E$, if $(u, v)$ is part of a shortest path (in terms of weight) from $s$ to $v$, then for every $k \geq 0, d_k(u) \leq d_k(v)$.

Which one of the following options is correct?

A

Only S1 is true

B

Only S2 is true

C

Both S 1 and S 2 are true

D

Neither S1 nor S2 is true

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

Let $G(V, E)$ be a simple, undirected, edge-weighted graph with unique edge weights. Which of the following statements about the minimum spanning trees (MST) of $G$ is/are true?

A

In every cycle $C$ of $G$, the edge with the largest weight in $C$ is not in any MST

B

In every cycle $C$ of $G$, the edge with the smallest weight in $C$ is in every MST

C

For every vertex $v \in V$, the edge with the largest weight incident on $v$ is not in any MST

D

For every vertex $v \in V$, the edge with the smallest weight incident on $v$ is in every MST

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

Consider the following C statements:

char str1 = "Hello; / Statement S1 */

char str2 = "Hello;"; / Statement S2 */

int str3 = "Hello"; / Statement S3 */

Which of the following options is/are correct?

A

S 1 and S 2 have syntactic errors

B

S 2 has a lexical error and S 3 has a syntactic error

C

S 1 has a lexical error and S 3 has a semantic error

D

S1 has a syntactic error and S3 has a semantic error

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

Which of the following statements is/are true?

A

$\mathrm{LL}(1)$ parser uses backtracking

B

For a grammar to be $\mathrm{LL}(1)$, it must be left-recursive

C

For a grammar to be $\mathrm{LL}(1)$, it must be left-factored

D

The $\mathrm{LL}(1)$ parsers are more powerful than the SLR parsers