5 void prep_kmp( double *text2
, double *pattern2
, int m
, int n
)
13 while (j
> -1 && pattern2
[i
] != pattern2
[j
])
19 if (pattern2
[i
] == pattern2
[j
])
20 kmpNext
[i
] = kmpNext
[j
];
26 unsigned int search_kmp( double *text2
, double *pattern2
, int m
, int n
)
28 prep_kmp( text2
, pattern2
, m
, n
);
30 unsigned int i
= 0, j
= 0, matches
= 0;
32 #define limit n * n - (n * ( m - 1 ))
35 while (j
> -1 && pattern2
[j
] != text2
[i
])