Skip to content
Related Articles

Related Articles

ISRO | ISRO CS 2020 | Question 73
  • Last Updated : 09 Sep, 2020
GeeksforGeeks - Summer Carnival Banner

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

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :