Naive Algorithm Again


\begin{algorithm}
{Naive-Pattern-Matcher-2}{T,P}
 n \= \mbox{length[T]}\  m \= ...
 ...\ shift''}\ s \  s \= s+1
 \ELSE s \= s+1
 \end{IF} \end{WHILE} \end{algorithm}

Same algorithm as before, but check P right-to-left instead.

When would this alone help?


next up previous
Next: Boyer-Moore Algorithm Up: BOYER-MOORE Previous: BOYER-MOORE