Hey everyone!
For last couple of days I have been working on creating a class for Trie data structure. This class provides few necessary and standard functions out of the box!
Here it is : Link
Also , I have added support for creating Persistent Trie. (You can learn about it over here)
You can see in this submission how easy it is to use this class for solving questions on persistent trie!
I invite all of you to use this template , suggest changes/improvements , point out errors, anything you think should be enhanced or added!
You can contact via commenting , DM or even raise a pull request and be a contributor!
Looking forward to your responses! :D
Thank you! :)
PS : Watch the github repository to know about future additions. Star if you like my work! :D
Thanks, I was looking for something without pointers. Is it possible for most persistence problems to solve them without pointers?
Yup it definitely is! Instead of using malloc , just make a vector from where all your allocations take place, and instead of storing a pointer , store index for that element!
You can add 'deletion' operation?
Yup why not! will work on that :D Thanks for suggestion!
Your code is giving compile error. After declaring int freq inside struct TrieNode it works.
Resolved!So sorry for the inconvenience! Thanks for pointing it out! :D
There is also an issue with printing correct frequencies. Maybe because they are not intialized. Edit — Now I think it's correct.
I have not yet tested the code to work on frequencies! :( maybe you can recommend me some question relating to frequency where i can test this template?
EDIT : tested!
revolutionary
Thanks! XD