質問

I have heard that DFA can be simulated by Loop and NFA can be simulated by recursive method. I don't understand how that works. Can anyone give me an example?

役に立ちましたか?

解決

In a sense, sure. DFAs can easily be simulated by writing a do...while loop with a switch statement in it based on the current state, whereas you can think of a simulator for NFAs as doing a search on a tree (depth first search is recursive, although you could just as well imagine a breadth-first search). There's not really any formality in this, just a casual observation about how you might implement simulators.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top