Content deleted Content added
updated definitions of substring, prefix and suffix, which contained several errors |
→Substring: fix typo; suggest to explain new definition along the example |
||
Line 9:
== Substring ==
A string <math>u</math> is a substring (or factor)<ref name=Lot97/> of a string <math>t</math> if there exists two strings <math>p</math> and <math>
Example: The string <math>u=</math><code>ana</code> is equal to substrings (and subsequences) of <math>t=</math><code>banana</code> at two different offsets:
banana
Line 18:
|||
ana
The first occurrence is obtained with <math>p=</math><code>b</code> and <math>s=</math><code>ne</code>, while the second occurence is obtained with <math>p=</math><code>ban</code> and <math>s</math> being the empty string.
In the mathematical literature, substrings are also called '''subwords''' (in America) or '''factors''' (in Europe).
|