Prefix:
1x
Trie Visualizer

Trie — Autocomplete

Step 1 of 6

Autocomplete is one of the most practical Trie applications. Pick a prefix and watch the algorithm walk the prefix path, then DFS-collect every word reachable from that point.

How Autocomplete Works

Phase 1: walk the prefix char-by-char (O(L)). If any char is missing, return []. Phase 2: DFS from the prefix endpoint — every node with isEnd=true is a valid completion.

prefix = "ap"
["app","apple","apply","application","apt"]
prefix = "ba"
["ball","bat","band","ban"]
prefix = "ca"
["cat","can","cap"]