Trie Insert
Walk existing character edges, create the missing ones, and mark the final node terminal.
Decision · step 2 of 19Trie: Insert words sharing prefixes
"car", letter 'c'. No child 'c' yet, so create one and step into it.
What you will see
Focus follows shared prefix edges, then new nodes sprout for the rest of the word.
Cost
| Best | O(L) |
|---|---|
| Average | O(L) |
| Worst | O(L) |
| Space | O(L) |
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.
Before this
Related
Taught by the same lesson
Trie covers these too, in the same run.