Skip to content
BytePatterns

Tries

A tree of prefixes: autocomplete, word search and spell-check in one shape.

Tries progress0 / 4
  1. Trie BasicsStore words by their letters so shared prefixes are stored once.5m
  2. Prefix SearchWalk to the prefix once, then everything below it is the answer.5m
  3. Word Search With a TrieOne walk over the grid, pruned the moment the path stops being a prefix.6m
  4. Trie vs Hash SetA set answers 'is this word here'. A trie answers 'what starts with this'.4m

Quiz yourself: 3 questions from this module

1 / 3

What does one edge of a trie represent?