1.

The regular expression with all strings of 0′s and 1′s with at least two consecutive 0′s is?(a) 1 + (10)*(b) (0+1)*00(0+1)*(c) (0+1)*011(d) 0*1*2*The question was posed to me in an online interview.My question is based upon Regular Expression topic in section Compiler Introduction of Compiler

Answer»

The correct option is (b) (0+1)*00(0+1)*

The explanation: The expression (0+1)*00(0+1)* is where EITHER it initially takes 0 or 1 or 00 FOLLOWED by string of COMBINATION of 0 and 1.



Discussion

No Comment Found

Related InterviewSolutions