Lecture 28

We introduced the problem of the exact-match problem for strings: given two strings P and T (pattern and text) we wish to find all occurrences of P in T. The naive algorithm yielded a O(nm) algorithm which is very bad.

We superficially dicussed the Boyer-Moore and KMP algs, and then dove in to the Z-Algorithm.

We defined Z values, Z-boxes, and the r- and l- values. Z-values were central to the homework: Z_i(S) is the longest substring starting at position i of S which matches a prefix of S.