Fast Parallel and Serial Approximate
Consider the string matching problem, where di erences between charac-
ters of the pattern and characters of the text are allowed. Each di erence
is due to either a mismatch between a character of the text and a character
of the pattern, or a super uous character in the text, or a super uous char-
acter in the pattern. Given a text of length n, a pattern of length m and
an integer k, serial and parallel algorithms for nding all occurrences of
the pattern in the text with at most k di erences are presented. For com-
pleteness we also describe an e cient algorithm for preprocessing a rooted
tree, so that queries requesting the lowest common ancestor of every pair
of vertices in the tree can be processed quickly.
Input form. Two arrays: A = a1;:::;am - the pattern, T = t1;:::;tn - the
text and an integer k ( 1).
In the present chapter we will be interested in nding all occurrences
of the pattern string in the text string with at most k di erences.
Three types of di erences are distinguished:
(a) A character of the pattern corresponds to a di erent character of the