18
Exercise #2: Naive Matching
Suppose all characters in
P
are different.
Can you accelerate
NaiveMatching
to run in
O(n)
on an
n
-character text
T
?