Strings Flashcards

1
Q

Name of O(n) algo for simple pattern matching a string of length n

A

KMP (Knuth Morris Pratt)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly