AlgoScope

Prefix Search and Autocomplete

AlgorithmintermediateTrie Operations

Walk the prefix, then enumerate every terminal below it with a DFS.

Result · step 3 of 7Trie: Autocomplete: everything under ca
•car✓t✓t✓dog✓

Letter 'a': follow it.

Open in the player →or start at step 3

What you will see

The prefix path lights up; a traversal fans out below it, emitting words.

How trie works →

Cost

BestO(L)
AverageO(L + results)
WorstO(L + subtree)
SpaceO(depth)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next.

Screen readers: Text and pattern cells announce index and character; each step announces the aligned positions, the comparison result and the shift.

Reduced motion: The pattern row snaps to its new alignment with a crossfade instead of sliding.

Taught by the same lesson

Trie covers these too, in the same run.