Following a word costs O(length), independent of how many other words exist.
Tries and Prefix Search
4 chapters · 6 challenges · The Glyph Garden
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What is a trie?
A trie is a tree whose edges represent characters or tokens. Words with the same prefix share the same opening path, making prefix queries proportional to the query length.
Think of autocomplete paths. Typing c → a reaches the shared branch for cat, car, and care. The structure does not restart from every word.
Shared prefixes become shared paths; word endings need an explicit marker.
Store an end marker so car and cart can both exist.
An unknown character may require exploring every matching child.
Walk the common prefix
Prefix Tree
0/3 completePractice prefix tree through 3 visual expeditions.
Wildcard Search
0/1 completePractice wildcard search through 1 visual expedition.
Autocomplete
0/1 completePractice autocomplete through 1 visual expedition.
Final challenge
0/1 completeCombine the skills from this world in a final challenge.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.