Tries: Difference between revisions

From Wiki :-)
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
Tries is used to store words in a tree. From the root to the leaves, it forms a word.
Trie (or prefix tree) is used to store words in a tree. From the root to the leaves, it forms a word.


To implement a tries, each node should contain a flag that indicates if it is a complete word and a hash-map whose key is the subsequent characters and the value is the node.
To implement a tries, each node should contain a flag that indicates if it is a complete word and a hash-map whose key is the subsequent characters and the value is the node.

Latest revision as of 06:16, 3 October 2020

Trie (or prefix tree) is used to store words in a tree. From the root to the leaves, it forms a word.

To implement a tries, each node should contain a flag that indicates if it is a complete word and a hash-map whose key is the subsequent characters and the value is the node.

Resources

https://www.youtube.com/watch?v=zIjfhVPRZCg