// ls-sans-memoire-faible-lineaire.c // << Algorithmique du texte >> // Maxime Crochemore, Christophe Hancart et Thierry Lecroq // Vuibert, 2001. #include <stdio.h> #include "chl.h" void lsSansMemoireFaibleLineaire(Mot x, Longueur m, int bonSuff[], Mot y, Longueur n) { int i, j, ell; ell = 0; j = m - 1; while (j < n) { i = m - 1; while (i >= ell && x[i] == y[j - m + 1 + i]) --i; signalerSi(i < ell); if (i < ell) { ell = m - bonSuff[0]; j += bonSuff[0]; } else { ell = 0; j += bonSuff[i]; } } }