Skip to content
DSA Visualizerpreview

Trie: insert and search

Each letter is a step down; shared prefixes are stored once. ✓ marks where a word ends.

O(length of the word) time · O(total characters) space

Wordscar, cart, cat, dog, do, ?ca, ?cat, ?dot

Start with an empty trie: just the root.

Trie of 0 letters.
  • compare
  • swap or write
  • settled

1 / 31

Speed

Space play · ← → step · Home End jump · drag the strip to scrub