Concepts3
⚙️AlgorithmIntermediate
Minimum Rotation
The minimum rotation of a string is the lexicographically smallest string you can get by cutting it at some position and swapping the two parts.
#minimum rotation#booth algorithm#duval algorithm+12
⚙️AlgorithmIntermediate
KMP - Prefix Function Applications
The prefix function π of a string tells, for every position, the length of the longest proper prefix that is also a suffix of the prefix ending there.
#kmp#prefix function#failure function+11
⚙️AlgorithmIntermediate
KMP Algorithm
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.
#kmp algorithm#prefix function#failure function+12