next up previous
Next: Up: Previous:

Information for Good Suffix Heuristic

$\gamma$[j] = m - max{k $\mid$ 0 $\leq$ k < m and P[j+1..m] $\sqsupset$Pk or Pk$\sqsupset$ P[j+1..m]}

$\sqsupset$ means suffix (note: $x \sqsupset x$)



If match j+1..m and P[j] $\neq$ T[s+j], shift right $\geq$$\gamma$[j]

Examples

googoo

\begin{displaymath}\begin{array}{\vert c\vert c\vert c\vert c\vert c\vert c\vert c\vert} \hline 3 & 3 & 3 & 3 & 3 & 1 & 1 \\ \hline
\end{array}\end{displaymath}

j = 0, P3$\sqsupset$ P[1..6]

googo

\begin{displaymath}\begin{array}{\vert c\vert c\vert c\vert c\vert c\vert c\vert} \hline 3 & 3 & 3 & 3 & 2 & 1 \\ \hline
\end{array}\end{displaymath}


next up previous
Next: Up: Previous: