The time complexity of compromises nfa vs dfa

I am looking for a discussion which is better to use and under what circumstances in an NFA or DFA compiler. What are the temporary trade-offs in the complexity of NFA versus DFA modeling, and which one is more suitable under what circumstances in the compiler?

+3
source share
1 answer
  • The time to build the DFA from the NFA is O (2 ^ m), where m is the number of nodes.
  • DFA runtime is O (n), where n is the length of the input string. This is because there is only one path for a given line through DFA.
  • NFA build time should be O (m), where m is the number of nodes
  • NFA O (m²n), , . ( , , , , )

+1

Source: https://habr.com/ru/post/1783142/


All Articles