Machine-translated by Google. Questions are authored in English.
Top

Discussion

Write an Regular expression :

Starting with 0's or 1's ending with '01' is equivalent to :

  • A.(0 + 1)* 11
  • B.(0 + 1)* 00
  • C.(0 + 1)* 01
  • D.(0 + 1)* 10

Answer: C

The expression is (0 + 1)* 01.

(0 + 1)* matches any string of 0s and 1s, including the empty string, so it covers whatever comes first. Appending 01 forces the string to end with 0 followed by 1. Every binary string ending in 01 can be split this way, and every string the expression generates ends in 01.

The other options fix the wrong ending: (0 + 1)* 11 ends in 11, (0 + 1)* 00 in 00, and (0 + 1)* 10 in 10.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.