What is a Trie?

This lesson gives a brief introduction to Trie, its properties, and common applications.


In the previous section, we covered several common types of trees, like Red-Black trees, 2-3 trees, etc.

Now, we are going to look at a tree-like data structure, which proves to be really efficient while solving programming problems related to strings.

This data structure is called a Trie and is also known as a Prefix Tree. We will soon find out why.

💡 Did you know?

Trie basically comes from the word “retrieval”, as the main purpose of using this structure is that it provides fast retrieval. Tries are mostly used for searching words in the dictionary, provide auto-suggestions in search engines, and for IP routing as well.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.