ISRO | ISRO CS 2020 | Question 73

The language which is generated by the grammar S → aSa|bSb|a|b over the alphabet {a, b} is the set of
(A) Strings that begin and end with the same symbol
(B) All odd and even length palindromes
(C) All odd length palindromes
(D) All even length palindromes


Answer: (C)

Explanation: This grammar generates strings {a, b, aba, bab, baaab, abbba, …}, it means dd length palindromes. But it can not generates even length palindroms.

Option (C) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.