Content deleted Content added
trying to make the article stand alone a little better |
Moved code example to discussion, for it may be incorrect. |
||
Line 1:
The '''Knuth-Morris-Pratt [[string searching algorithm]]''' locates a pattern of characters within a string. It uses the fact that after finding the first mismatch between pattern and string we already know the characters compared before to improve the efficiency of the search. We therefore will have to compare the pattern to itself to determine how many positions we have to move to the left.
|