Practice
Learn
← Quit
0 / 0 correct
Algorithms
Hard
1 of 10
How does KMP achieve O(n + m) string matching?
A
It hashes all substrings
B
A failure (prefix) function tells how far to shift the pattern after a mismatch without re-examining text characters
C
It sorts the text
D
It compares from the end of the pattern only