Encyclopedia of Database Systems

2018 Edition
| Editors: Ling Liu, M. Tamer Özsu

Trie

  • Maxime Crochemore
  • Thierry Lecroq
Reference work entry
DOI: https://doi.org/10.1007/978-1-4614-8265-9_1143

Synonyms

Prefix tree

Definition

A trie is a rooted tree used for storing associative arrays where keys are usually strings. Edges are often labeled by individual symbols. Then common prefixes are factorized. Each node of the trie is associated with a prefix of a string of the set of strings: concatenation of the labels of the path from the root to the node. The root is associated with the empty string. Strings of the set are stored in terminal nodes (leaves) but not in internal nodes. A trie can be seen as a deterministic finite automaton.

Tries can be compacted. To get a compact trie from a trie, internal nodes with exactly one successor are removed. Then labels of edges between remaining nodes are concatenated. Thus, edges are labeled by strings:
  • Internal nodes have at least two children.

  • Edges outgoing an internal node are labeled by strings starting with different symbols.

Historical Background

Tries were first recommended by de la Briandais [2]. The word “trie” comes from...

This is a preview of subscription content, log in to check access.

Recommended Reading

  1. 1.
    Crochemore M, Hancart C, Lecroq T. Algorithms on strings. Cambridge: Cambridge University Press; 2007.zbMATHCrossRefGoogle Scholar
  2. 2.
    de la Briandais R. File searching using variable length keys. In: Proceedings of the Western Joint Computer Conference; 1959. p. 295–8.Google Scholar
  3. 3.
    Fredkin E. Trie memory. Commun ACM. 1960;3(9):490–9.CrossRefGoogle Scholar
  4. 4.
    Gonnet GH, Baeza-Yates R. Handbook of algorithms and data structures – in Pascal and C. 2nd ed. Addison-Wesley, Reading, 1991.zbMATHGoogle Scholar
  5. 5.
    Gusfield D. Algorithms on strings, trees and sequences. Cambridge: Cambridge University Press; 1997.zbMATHCrossRefGoogle Scholar
  6. 6.
    Knuth DE. The art of computer programming. Volume 3: sorting and searching. 3rd ed. Addison-Wesley, Reading; 1997. Section 6.3: digital searching, p. 492–512.Google Scholar
  7. 7.
    Morrison DR. PATRICIA – practical algorithm to retrieve information coded in alphanumeric. J ACM. 1968;15(4):514–34.CrossRefGoogle Scholar
  8. 8.
    Sedgewick R, Flajolet P. An introduction to the analysis of algorithms. Reading: Addison-Wesley; 1996.zbMATHGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.King’s College LondonLondonUK
  2. 2.Université Paris-EstParisFrance
  3. 3.Université de RouenRouenFrance