1.

The context free grammar S → SS | 0S1 | 1S0 | ɛ generates _________(a) Equal number of 0’s and 1’s(b) Unequal number of 0’s and 1’s(c) Number of 0’s followed by any number of 1’s(d) None of the mentionedI have been asked this question in final exam.I'm obligated to ask this question of Context Free Grammar topic in section Contextfree Grammar and Syntax Analysis of Compiler

Answer»

The correct answer is (a) Equal number of 0’s and 1’s

To EXPLAIN I would say: S->SS

S->0S1S

S->0S11S0

S->0110.



Discussion

No Comment Found

Related InterviewSolutions