Trie

A trie is a specialized tree used in text searching. Another name for a trie is prefix tree. It's a tree-like data structure which is efficient in solving these problems specific to strings. You can think of it as auto completion.

The benefit of this type of data structure is speed and space. With speed, the big O is O (length of the word). With space, we do not have to store in multiple times for different words. It's stored in one location and you have children linking to it.

Last updated