Problem
Consider the pattern P=BBABAB and the text T=ABBABBABABBABABBA.
i. Compute the prefix function for the pattern P of the Knuth-Morris-Pratt algorithm.
ii. Use the Knuth-Morris-Pratt algorithm to find all appearances of P in 7.
Show the comparisons the KMP makes for the pattern in the text.