Skip to content
Related Articles

Related Articles

GATE | GATE-CS-2015 (Set 3) | Question 42
  • Last Updated : 24 Feb, 2015
GeeksforGeeks - Summer Carnival Banner

Which of the following languages are context-free?

L1 = {ambnanbm ⎪ m, n ≥ 1}
L2 = {ambnambn ⎪ m, n ≥ 1}
L3 = {ambn ⎪ m = 2n + 1} 

(A) L1 and L2 only
(B) L1 and L3 only
(C) L2 and L3 only
(D) L3 only


Answer: (B)

Explanation: We can build a push down automata for L1 and L3, but can not build push down automata for L@.

Note that a PDA can uses a stack. L1 and L3 can be identified using a single stack, but L2 can’t be.


Quiz of this Question

sudo-gate-course

My Personal Notes arrow_drop_up
Recommended Articles
Page :