DEV Community

Rohan Navlakhe
Rohan Navlakhe

Posted on

Data Structure used behind Dictionary apps & Search Engines Auto-Complete Feature

Ever wondered how search engines and dictionary apps suggest the right words as you type? It's all thanks to Trie Data Structure! 😃

The data structure behind the auto-complete feature is also Trie.

Trie is also called “Prefix Tree”. Trie is best suitable when you want to search Strings based on the prefix string (like we do in the dictionary app, where if we enter “app” it shows us suggestions like “apple”, “application” etc.)

Using Trie we can insert and search for the strings in O(k) time where k is the length of the string we want to insert or search. 🚀

and yes, Trie has been derived from reTRIEval word.

Top comments (0)