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