Groups
Category
The KMP algorithm finds all occurrences of a pattern in a text in O(n + m) time by never re-checking characters that are already known to match or mismatch.
Manacher's algorithm finds the length of the longest palindrome centered at every position in a string in linear time O(n).