Skip to content
StackDecode
StringsExplained

Trie-based String Search

Follow one edge per character in a prefix tree.

Time

O(m)

Extra space

O(total chars)

Use it for

Autocomplete, dictionaries, prefix queries.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.