Gate CS-2007 Question Paper With Solutions

Q. 20 Solve the problems and choose the correct answers.

Consider the CFG with {S,A,B} as the non-terminal alphabet, {a,b} as the

terminal alphabet, S as the start symbol and the following set of production rules

S --> aB        S --> bA
B --> b         A --> a
B --> bS        A --> aS
B --> aBB       A --> bAA

Which of the following strings is generated by the grammar?

(A) aaaabb

(B) aabbbb

(C) aabbab

(D) abbbba

Answer: (C)

Explanation:

Gate CS-2007 Question Paper With Solutions

Learn More:   Gate EE-2004 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here