Tries: Difference between revisions

From Wiki :-)
Jump to navigation Jump to search
Created page with "Tries is used to store words in a tree. From the root to the leaves, it forms a word. Each node should contain a flag that indicates if it is a complete word."
 
No edit summary
 
(One intermediate revision by the same user not shown)
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.


Each node should contain a flag that indicates if it is a complete 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 ==
{| class="wikitable"
!
|-
|https://www.youtube.com/watch?v=zIjfhVPRZCg
|}

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