Radix Tree
A trie where chains of single-child nodes are merged into one edge labelled with a string.
From the root, the edge "c" leads into a chain of 1 node that each have one child and end no word. Nobody can branch off inside it, so the whole chain becomes a single edge labelled "ca". 1 node gone.
What you will see
Long edges labelled with substrings; insert may split an edge.
Cost
| insert | O(L) |
|---|---|
| search | O(L) |
| Space | O(number of words) |
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, try operations in any order.
Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.
Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.
Before this
Related
Taught by the same lesson
Radix Tree, Suffix Tree, Aho-Corasick covers these too, in the same run.