The GATE Grind

GATE 2009 CS – Question 12

Theory of Computation · Context-Free Grammars and Pushdown Automata · 1 mark · Multiple choice

The grammar $S\to aSa\mid bSb\mid a\mid b$ generates which language over {a, b}?

  1. all palindromes.
  2. all odd-length palindromes.
  3. strings that begin and end with the same symbol.
  4. all even-length palindromes.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) all odd-length palindromes.

Explanation

We are sorry we couldn't write detailed soluition for this, we are working on it!, please consider asking your own AI, its just 2-3 clicks with very minimum effort

More Context-Free Grammars and Pushdown Automata questions

All Context-Free Grammars and Pushdown Automata questions →