- GATE CS
- 2026–27 pattern practice
- Theory of Computation
- Context-free grammars
- Easy
Which of the following languages is NOT context-free?
Context-Free Languages
Pick an option to check your answer.
Answer: B. Solution
needs three counts to match, but a pushdown automaton has a single stack, which can match only one pair. The pumping lemma for CFLs confirms it is not context-free.
Why not the others
- is generated by .
- , even-length palindromes, is generated by .
- is regular, and every regular language is context-free.