In computer science, a trie, also called digital tree and sometimes radix tree or prefix tree (as they can be searched by prefixes), is a kind of search tree—an ordered tree data structure that is used to store a dynamic set or associative array where the keys are usually strings. Unlike a binary search tree, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key with which it is associated. All the descendants of a node have a common prefix of the string associated with that node, and the root is associated with the empty string. Values are not necessarily associated with every node. Rather, values tend only to be associated with leaves, and with some inner nodes that correspond to keys of interest. For the space-optimized presentation of prefix tree, see compact prefix tree.
In the example shown, keys are listed in the nodes and values below them. Each complete English word has an arbitrary integer value associated with it. A trie can be seen as a tree-shaped deterministic finite automaton. Each finite language is generated by a trie automaton, and each trie can be compressed into a deterministic acyclic finite state automaton.
Though tries are usually keyed by character strings, they need not be. The same algorithms can be adapted to serve similar functions of ordered lists of any construct, e.g. permutations on a list of digits or shapes. In particular, a bitwise trie is keyed on the individual bits making up any fixed-length binary datum, such as an integer or memory address.
Etymology 1 vb. (obsolete spelling of try English) Etymology 2
n. (context computer science English) An ordered tree data structure that is used to store an associative array where the keys are usually strings.
Usage examples of "trie".
Airborne paratroopers were among the heroes of D-Day, the Battles of the Bulge and Bastogne, and had helped liberate styrer trie ljuwtitstj Normandy, Holland, Belgium, Sicily, Italy, and North Africa.
In retiring being in the midst of a low quagmire, and minding them more than my steps, I stept fast into the quagmire, and also the Indian in drawing me forth: thus surprised, I resolved to trie their mercies, my armes I caste from me, till which none durst approch me: being ceazed on me, they drew me out and led me to the King, I presented him with a compasse diall, describing by my best meanes the use thereof, whereat he so amazedly admired, as he suffered me to proceed in a discourse of the roundnes of the earth, the course of the sunne, moone, starres and plannets, with kinde speeches and bread he requited me, conducting me where the canow lay and John Robinson slaine, with 20 or 30 arrowes in him.
Cursing, he trie d again, this time transposing two vowels and a glottal stop: the lock sprang open.
Purchased by a Vidian dealer, she was passed on to the Solarch of Trie, whose chief of staff, recognizing the patrician lines of the vessel, refitted her as his personal scout.