AlgoScope

Trie Search

Walk the characters. The word exists if the walk succeeds and ends on a terminal node.

String algorithms, algorithm, intermediate
Follow c.•carttdognode
Follow c.•carttdognode

Trie: Search for a stored word

Decision, step 2 of 7

Letter 'c'. Children here: c, d. Follow 'c'.

How trie works

Cost

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

Leads to

Topics that need this one first.

Taught by the same lesson

Trie covers these too, in the same run.