GATE | Gate IT 2007 | Question 48
Consider the grammar given below
S → x B | y A
A → x | x S | y A A
B → y | y S | y B B
Consider the following strings.
(i) xxyyx
(ii) xxyyxy
(iii) xyxy
(iv) yxxy
(v) yxx
(vi) xyx
Which of the above strings are generated by the grammar ?
(A) (i), (ii), and (iii)
(B) (ii), (v), and (vi)
(C) (ii), (iii), and (iv)
(D) (i), (iii), and (iv)
Answer: (C)
Explanation: Only iii and iv are possible.
Quiz of this Question
Please comment below if you find anything wrong in the above post
Please Login to comment...