Skip to content
trie
EntityQ387015· pop 26· linked from 247 articles

Also known as digital tree, radix tree, prefix tree

thumb|250px|A trie for keys "A", "to", "tea", "ted", "ten", "i", "in", and "inn". Each complete English word has an arbitrary integer value associated with it.|alt=Depiction of a trie. Single empty circle, representing the root node, points to three children. The arrow to each child is marked by a different letter. The children themselves have similar sets of arrows and child nodes, with nodes that correspond to full words bearing blue integer values. In computer science, a trie (, ), also known as a digital tree or prefix tree, is a specialized search tree data structure used to store and ret

Key facts

Data structure.name
Trie
Data structure.invented_by
Edward Fredkin, Axel Thue, and René de la Briandais
Data structure.caption
corresponds to length of the keys. corresponds to number of the keys.
Data structure.invented_year
1960
Data structure.type
Tree

via Wikipedia infobox

Wikidata facts

Show 1 more fact
Commons category
Trie
Sources (2)

via Wikidata · CC0

~13 min read

Article

21 sections
Contents
  • History, etymology, and pronunciation
  • Overview
  • Operations
  • Searching
  • Insertion
  • Deletion
  • Replacing other data structures
  • Replacement for hash tables
  • Implementation strategies
  • Bitwise tries
  • Compressed tries
  • Patricia trees
  • Applications
  • Sorting
  • Full-text search
  • Web search engines
  • Bioinformatics
  • Internet routing
  • See also
  • References
  • External links

thumb|250px|A trie for keys "A", "to", "tea", "ted", "ten", "i", "in", and "inn". Each complete English word has an arbitrary integer value associated with it.|alt=Depiction of a trie. Single empty circle, representing the root node, points to three children. The arrow to each child is marked by a different letter. The children themselves have similar sets of arrows and child nodes, with nodes that correspond to full words bearing blue integer values. In computer science, a trie (, ), also known as a digital tree or prefix tree, is a specialized search tree data structure used to store and retrieve strings from a dictionary or set. Unlike a binary search tree, nodes in a trie do not store their associated key. Instead, each node's position within the trie determines its associated key, with the connections between nodes defined by individual characters rather than the entire key.

Tries are particularly effective for tasks such as autocomplete, spell checking, and IP routing, offering advantages over hash tables due to their prefix-based organization and lack of hash collisions. Every child node shares a common prefix with its parent node, and the root node represents the empty string. While basic trie implementations can be memory-intensive, various optimization techniques such as compression and bitwise representations have been developed to improve their efficiency. A notable optimization is the radix tree, which provides more efficient prefix-based storage.

Gallery (6)

Connections

Categories