GATE CS 2026 Set 2 | Question 48
Theory of Computation › Context Free Grammar · MSQ · 2 marks · Answer: A, C, D
- Question 48Theory of Computationmsq2 marksLet and let . Which of the following constraints ensure(s) that the language is context-free?
- A.✓
- B.and
- C.and✓
- D.✓
Answer: A, C, D
Solution
Answer: (A), (C), (D) - (A) : a single balance condition — can be checked with one stack counter. CF ✓ - (B) and : two independent, interleaved comparisons ( and ) — needs two stacks. Not CF ✗ - (C) and : nested matching — a single stack suffices. CF ✓ - (D) : one balance condition. CF ✓ - A.
More GATE PYQ on Context Free Grammar
All GATE CS Theory of Computation PYQ →Attempt GATE CS 2026 Set 2 in real GATE exam mode
Full paper with a timer, the GATE interface and a topic-wise analysis — free.
Create free account →