AlgoScope

Radix Tree

Data structureadvancedString Structuresalso called compressed trie, Patricia trie

A trie where chains of single-child nodes are merged into one edge labelled with a string.

Decision · step 2 of 3Radix Tree, Suffix Tree, Aho-Corasick: Radix tree: chains become labelled edges
ca•cartet

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.

Open in the player →or start at step 2

What you will see

Long edges labelled with substrings; insert may split an edge.

How radix tree, suffix tree, aho-corasick works →

Cost

insertO(L)
searchO(L)
SpaceO(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

Leads to

Topics that need this one first.

Taught by the same lesson

Radix Tree, Suffix Tree, Aho-Corasick covers these too, in the same run.