Update Trie.md

This commit is contained in:
Aakash Panchal 2020-05-24 00:54:24 +05:30 committed by GitHub
parent f7bea0e794
commit f6387c0b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,9 +19,11 @@ Trie is a very useful and special kind of data structure for string processing.
Trie is a tree of nodes, where the specifications of a node can be given as below:
Each node has,
1. An array of datatype `node` having the size of the alphabet(see the note below).
1. An array of size of the alphabet(see the note below).
2. A boolean variable.
**Note:** For an easy understanding purpose, we are assuming that all strings contain lowercase alphabet letters, i.e. `alphabet_size` is $26$. **We can convert characters to a number by using `c-'a'`, `c` is a lowercase character.**
**We will see usages of these two variables soon.**
```cpp
@ -41,8 +43,6 @@ struct trie_node
};
```
**Note:** For an easy understanding purpose, we are assuming that all strings contain lowercase alphabet letters, i.e. `alphabet_size` is $26$. **We can convert characters to a number by using `c-'a'`, `c` is a lowercase character.**
![enter image description here](https://github.com/KingsGambitLab/Lecture_Notes/blob/master/articles/Akash%20Articles/md/Images/Trie/3.png)
Now, we have seen how a trie node looks like. Let's see how we are going to store strings in a trie using this kind of node.