Reputation: 11
Construct a DFA that accept the following string A(B|(BC+))*C , i do not understand the sequence of the string really well
Upvotes: 0
Views: 162
Reputation: 2668
The string A(B|(BC+))*C
is usually a regular expression. In your case:
| means OR
+ means one or more occurrence of previous symbol
* means zero or more occurrence of previous symbol
The basic conversion:
AB --> {q0, A, q1}, {q1, B, q2}
A|B --> {q0, A, q1}, {q0, B, q1}
A+ --> {q0, A, q1}, {q1, A, q1}
A* --> {q0, A, q0}
{q0, s, q1}
means transition from state q0
to q1
by reading symbol s
You can try it first by yourself for the case you have. If you find difficulties, give comment.
Upvotes: 0