Sottostringa: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
|||
Riga 27:
== Prefisso ==
Un prefisso di una stringa <math>T = t_1 \dots t_n</math> è una stringa <math>\widehat T = t_1 \dots t_{m}</math>, dove <math>m \leq n</math>. Un ''prefisso proprio'' di una stringa ha lunghezza inferiore rispetto alla stessa (<math>0 \leq m < n</math>)<ref name=Kel95>{{en}} Gusfield, Dan (1999). Algorithms on Strings, Trees and Sequences: Computer Science and Computational Biology. USA: Cambridge University Press.</ref>; alcune definizioni<ref name=Gus97>{{en}} Kelley, Dean (1995). Automata and Formal Languages: An Introduction. London: Prentice-Hall International. ISBN 0-13-497777-7.</ref> in aggiunta richiedono che un prefisso proprio sia non vuoto (<math>0 < m < n</math>). Un prefisso può essere visto come un caso speciale di una sottostringa.
Esempio: La stringa <code>ban</code> è un prefisso (e sottostringa e sottosequenza) della stringa <code>banana</code>:
| |||