1.

Give a production grammar that specified language L = {ai b2i >= 1}.(a) {S->aSbb,S->abb}(b) {S->aSb, S->b}(c) {S->aA,S->b,A->b}(d) None of the mentionedThe question was posed to me during an online interview.Asked question is from Regular Grammar topic in division Contextfree Grammar and Syntax Analysis of Compiler

Answer»

Correct OPTION is (a) {S->ASBB,S->abb}

The BEST I can explain: S->aSbb, S->abb give a^Ia’s and b^2i b’s.



Discussion

No Comment Found

Related InterviewSolutions