Jump to content

Prefix (computer science)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nils Grimsmo (talk | contribs) at 21:05, 30 March 2006 (Placing citation in text). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A prefix of a string is a string such that , where . A proper prefix of a string is is not equal to the string itself and not empty[1] (). A prefix can be seen as a special case of a substring.

Example

The string ban is a prefix of the string banana:

T = banana
    |||
P = ban

See also

References

  • ^ Gusfield, Dan (1999) [1997]. Algorithms on Strings, Trees and Sequences: Computer Science and Computational Biology. USA: Cambridge University Press. ISBN 0-521-58519-8.