Prefix Function

Problems on the prefix function, including the Knuth-Morris-Pratt substring search, the period of a string, counting occurrences of each prefix, the shortest string that generates a given one, and automata for pattern matching.

Related problem sets are under Z-function, Strings and Hashing.

Problems