← Tries · guided lesson

Tries

1 / 20 · story

the story

Trie (prefix tree)

Every tool here exists because something was too slow or broke without it. Here is what.

1959–60 · René de la Briandais; Edward Fredkin (who named it)

In March 1959 René de la Briandais presented "File searching using variable length keys": store keys letter by letter in a tree, so a lookup reads one letter per level. In September 1960 Edward Fredkin independently described the same idea in "Trie Memory" (Communications of the ACM) and coined the name from re-trie-val. Fredkin meant it to be said like "tree"; many people say "try" to keep the two apart.

the problem it solved

Looking up keys of different lengths — words, codes — in time that depends on the key's length, not on how many keys are stored.

why it matters: without it

Every keystroke in a search box would rescan the whole list, or need a sorted copy plus a binary search per prefix.

sources: R. de la Briandais — File searching using variable length keys (Western Joint Computer Conference, 1959) ↗ · E. Fredkin — Trie memory (Communications of the ACM, 1960) ↗ · NIST Dictionary of Algorithms and Data Structures — trie (name and Fredkin's note on pronunciation) ↗ · Trie — history (de la Briandais 1959; Fredkin's independent 1960 description) ↗

also in this chapter: Binary trie (bitwise trie) · Trie-guided backtracking (many words at once)