문제

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