1.

S –> aSa| bSb| a| b; the language generated by the above grammar is the set of ____________(a) All palindromes(b) All odd length palindromes(c) Strings beginning and ending with the same symbol(d) All even length palindromesThis question was posed to me by my college director while I was bunking the class.Enquiry is from The NFA with epsilon in section Finite Automata and Regular Expression of Compiler

Answer»

The correct choice is (b) All odd length PALINDROMES

The best EXPLANATION: The STRINGS accepted by language are {a, b, aaa, BBB, ABA, bab,}. All the strings are odd length palindromes.



Discussion

No Comment Found

Related InterviewSolutions