Please wait
Loading technology simulations
The requested content is still loading.
Finished experimenting?
Save one completion to this browser's signed guest ledger, or directly to your account when signed in.
Please wait
Loading technology simulations
The requested content is still loading.
Save one completion to this browser's signed guest ledger, or directly to your account when signed in.
| op | trie | word list |
|---|---|---|
| search / insert | O(L) | O(n·L) |
| autocomplete | O(L+k) | O(n·L) |
1search(word):2 node = root3 for ch in word:4 if ch not a child: return NOT FOUND5 node = node.child[ch]6 return node.isEnd
This trie (prefix tree) simulator shows how words that share a prefix share a path, so the structure stores a whole dictionary compactly and looks anything up in O(L) — one node per character, no matter how many words are stored. Insert a word and watch it walk from the root, creating only the letters it needs; search a word and follow the path to a green word-end marker (or a dead end). The signature interaction is the trie's superpower: type a prefix, press Autocomplete, and the walk to the prefix node is followed by the whole subtree glowing purple while a suggestion list fills with every completion. A cost card contrasts the trie's O(L) search and O(L+k) autocomplete with scanning a word list at O(n·L), and a synced pseudocode panel highlights the per-character walk.
trie · prefix tree · autocomplete · typeahead search · string algorithms · O(L) lookup · shared prefixes
Browse all Technology simulations →
Free to use in your browser — no signup required. Found a bug or have an idea to make it better? Tell us.