Trie

Last updated

What is Trie?

A Trie, also called digital tree and sometimes radix tree or prefix tree, is a type of search tree that is used to store a dynamic set or associative array where the keys are usually strings. Unlike binary search trees, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key with which it is associated. All the descendants of any one node have a common prefix of the string associated with that node, and the root is associated with the empty string. A 'trie' is thus a way to represent the 'retrieval' of information and is a type of tree structure used for this purpose. Typical usage scenarios could be in storing a predictive text or autocomplete dictionary, such as found on your smartphone or search engine.

More in stage 11: Advanced Data Structures

Trie: common questions

Can I learn Trie in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Trie in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this Trie tutorial for beginners?

It is lesson 53 of 107 in the free Data Structures & Algorithms roadmap, in stage 11, Advanced Data Structures. If you are new to Data Structures & Algorithms, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me