Strings Flashcards
1
Q
Name of O(n) algo for simple pattern matching a string of length n
A
KMP (Knuth Morris Pratt)
2
Q
Rabin Karp time complexity
A
average and best-case running time of the Rabin-Karp algorithm is O(n+m), but its worst-case time is O(nm).