Hacker News new | ask | show | jobs
by tgv 31 days ago
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.
1 comments

Running NFA is O(nm) not NP.
Sorry, you're right. Capturing worst case was much more expensive, I believe, but I'm no longer sure.
So it is NP (in fact P)