Closed fridis closed 3 days ago
Other algorithms that do not have quadratic complexity include Boyer-Moore: https://stackoverflow.com/questions/56418773/when-is-rabin-karp-more-effective-than-kmp-or-boyer-moore https://www.cs.utexas.edu/~moore/publications/sustik-moore.pdf
Boyer-Moore seems to offer predictable performance as well.
Currently, our implementation of
Sequence.find
may end up requiring quadratic runtime. We should use the KMP Algorithm, a racket version is presented here. A test case that requires quadratic time is("a"*2*n).find "a"*n+"b"
.