Digital dictionary:trie implementation


please debug and modify the code with needful coorections

@Vibhuti0206
There are plenty of compilation errors in your code like using “Node” instead of “node” at several instances.
At one point you have tried to store an iterator in an int variable.
Change it to auto i = temp->children.begin() .
Also there are a couple of syntax errors as well like you have written the ‘->’ operator incorrectly as just ‘>’.
Correct them please and share your code again.
Also Line No. 41 , it should temp=n; instead of n=temp;

Make the required changes and share your code again if you still need any help.

https://ide.codingblocks.com/s/162317,still not working

@Vibhuti0206
Still plenty of compilation errors remaining. You need to resolve atleast those on your own. The compiler points them exactly where and what the problem is.

  1. You have misspelled “children” as “childre” at one instance.
  2. You have not declared “root” in your main() yet your are accessing it. I think you might have to change some of your code to solve this as root is in class trie and not main().
  3. Line No. 12 , change d=data to data=d;

https://ide.codingblocks.com/s/163047,why is it giving wrong answer while sample input works fine?