- GATE CS
- 2026–27 pattern practice
- Theory of Computation
- Context-free grammars
- Easy
The grammar is
Context-Free Languages
Pick an option to check your answer.
Answer: D. Solution
has two leftmost derivations (two parse trees): one grouping , the other . Two parse trees for one string means the grammar is ambiguous.
Why not the others
- unambiguous is disproved by the example.
- regular — it is self-embedding and generates nested expressions.
- LL(1) — it is left-recursive and ambiguous, so it cannot be.