AlgoScope

Trie Insert

Walk existing character edges, create the missing ones, and mark the final node terminal.

String algorithms, algorithm, intermediate
car stored.•car
car stored.•car

Trie: Insert words sharing prefixes

Step, step 5 of 19

End of "car": mark this node terminal. Without the mark, a word that is only a prefix of another, or a prefix that is not a word, could not be told apart.

Cost

Best
O(L)
Average
O(L)
Worst
O(L)
Space
O(L)

Before this

Leads to

Topics that need this one first.

Taught by the same lesson

Trie covers these too, in the same run.