if in a word two alphabets are coming same how it will work?
Is children map is made new for every word?
for domo and dog is the same address of o is getting stored or what?
Yes we use the same ‘o’ and then tread down different paths. That’s the whole point of using tries.
for last ‘o’ of domo and ‘o’ in dog will have same address or what? i am getting confued in that in last ''o" of domo what address will it store?
or another will be created for last ‘o’ of domo which will be different from ‘o’ of dog?
can u plz explain this with example of map with values and tree plz
Its like simply going down the same path as long as you can go.
Now the do of both dog and domo will have the same path but after that the addresses will split up.
|->g
d->o-> |
|->m->o
They are at different levels or you can say they have different parents.
not cleared
plz create the unordered map with values to explain
Okay I don’t really understand what part you are confusing but give this article a read https://medium.com/basecs/trying-to-understand-tries-3ec6bede0014 ,this should help you in visualising tries.
Also try the question given at the end of this tutorial https://www.hackerearth.com/practice/data-structures/advanced-data-structures/trie-keyword-tree/tutorial/
And in case you are stuck with this question this is my code https://ide.codingblocks.com/s/224886
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.