Skip to content
Related Articles
Open in App
Not now

Related Articles

Aptitude | GATE IT 2006 | Question 4

Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

In the context-free grammar below, S is the start symbol, a and b are terminals, and ϵ denotes the empty string

S → aSa | bSb | a | b | ϵ

Which of the following strings is NOT generated by the grammar?

(A) aaaa
(B) baba
(C) abba
(D) babaaabab

Answer: (B)


The given Language is  Palindrome.

A,C and D follow the language but  baba  is not a palindrome  , so B is the answer

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!