Medium

Trie

A trie stores strings along a path of characters. The cost follows the length of the key, not the number of keys.

Costs

CategoryData Structure
DifficultyMedium
Insert a key of length kO(k)
Search a key of length kO(k)
Memorygrows with shared prefixes

Questions

What is Trie?

A trie stores strings along a path of characters. The cost follows the length of the key, not the number of keys.

Where do I practice it?

DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.