i am getting wrong answer in all three test cases even though my code is working totally fine with sample input https://ide.codingblocks.com/s/116978
Digital dictionary
Hello @Vasundhra-Bhardwaj-576869519460287,
Your code is logically correct.
The problem is in the question:
Though it is mentioned in the question, you have to insert the prefix(query) in the dictionary if it is not found (i.e. the case of no suggestions).
I have conveyed the same to your mentor and they would soon correct it.
Modification:
else {cout<<“No suggestions\n”;
insert(root,word);
return;}
Hope, this would help.
Give a like, if you are satisfied.
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.