shubham.
Resume ↗
Projects/Algorithms

Trie Autocomplete

Prefix-tree lookup and subtree traversal generate suggestions without scanning the full vocabulary.

2024

Character-path sharing and depth-first suggestion collection.

System overview

A prefix tree stores words as shared character paths. Prefix traversal locates the matching subtree; depth-first collection generates completions. Lookup follows prefix length, with collection cost depending on the matching subtree.

Prefix to suggestions

  1. Typed prefix
  2. Character traversal
  3. Prefix node
  4. Subtree search
  5. Matching words

Finding the prefix and enumerating its suggestions are separate operations.

↑ ↓ Browse · Enter Open · Esc Close