3 Instruction
In this question you need to write the DFA Simulator that can run a DFA against an input string. Given a DFA and an input string, the simulator will return yes if the DFA accepts the string, return false if the string is rejected. The Simulator algorithm in pseudo code is listed in Algorithm ??. You need to rewrite it into Java code, and make it work together with the DFA.java code. You can click the high-lighted link to download DFA.java. It is also listed at the end of this document. The code you should have the same class name and method name as is listed below:
Your code should work for any DFAs and input strings. You should test your code using sample DFAs and input
strings. One example is the DFA that corresponds the regular expression (a|b)(a|b|0|1)⇤, whose transition diagram is
as below.
Get Free Quote!
310 Experts Online