Trie (Prefix Tree)

About Tries

A Trie (prefix tree) is a tree-like data structure used to store a dynamic set of strings. Each node represents a single character, and paths from root to leaves represent words.

Use cases: Autocomplete, spell checking, IP routing, dictionary implementations.

Insert: O(m)
Search: O(m)
Delete: O(m)
Space: O(ALPHABET_SIZE * N * M)

m = length of word, N = number of words

Stored Words (0)

Enter a word to insert into the trie