logoalt Hacker News

tgvtoday at 6:49 AM1 replyview on HN

Depends on what you mean by that. You can convert every NFA into a DFA. That's a NP complete (IIRC), but running the DFA is O(n). Running the NFA without converting it is also NP complete. One isn't better than the other, but the costs vary for different expressions and usages.


Replies

DmitryOlshanskytoday at 8:01 AM

Running NFA is O(nm) not NP.