Give a regular expression for the set of binary strings in which every 0 is…
GATE · Computer Science · 1998
Give a regular expression for the set of binary strings in which every 0 is immediately followed by exactly k 1s and preceded by at least k 1s, where k is a fixed positive integer.
- A.
1∗1k(01k)∗ + 1+
- B.
1∗1k(01k)∗ + 1∗
- C.
1+1k(01k)∗ + 1+
- D.
1k(01k)∗ + 1∗
Attempted by 38 students.
Sign up free to check your answer
Sign up freeLoading lesson…