Day 18 — Tries
This chapter is being written. Check back soon!
What you’ll learn here
- Prefix trees: nodes, children pointers, the
isEndOfWordflag - The three core operations: insert, search, startsWith — each in O(L) where L is word length
- Real applications: autocomplete, spell-check, IP routing tables
- Compressed tries (radix trees) for when memory matters
Tries shine when your data is a set of strings sharing common prefixes. They make problems that look O(N·L) collapse to O(L).