Re:On a Great Interview Question
by bonzini on Thursday April 13, 2023 @03:15PM
(#35560665)
The DFA is O(n) with up to exponential time spent upfront (and exponential space usage too). The exact complexity for the NFA with the regex you suggest depends on how the NFA is built, but it is at least O(n^2) worst case because you can easily build a case with n active states. Likewise for the lazy DFA.
[ Parent
| on HN ]
There are no comments on this comment yet.