-1
Good morning, I am presenting a problem that I have no idea the reason, I have tried to ask other people, none discovered the real reason for the error and how to repair it. Good my teacher, asked to implement a system with which opens a txt file that contains words and those words should be stored in a trie tree. The implementation of this tree with a test is available at: https://www.geeksforgeeks.org/trie-insert-and-search/
Thus, the implementation of this tree is very close to what needs to be done, since through a string array the words are inserted into the tree. Below the "main" function of the implementation I provided from the link, the output of this program is all correct, indicating that there is the word "These" and there is the word "the"
[
So basically I adapted the code by reading the txt file and it didn’t work, I believe the problem may be related to the Insert method. I did a test too, printing all the words of the file and fortunately it worked, IE the problem is only in inserting the words
It doesn’t make sense for every word to be right on its way out. And at the time of telling if this word exists or not in the tree does not work, I used the same implementation that was working correctly. I’d really appreciate it if someone knew what I did wrong
https://pt.meta.stackoverflow.com/a/5485/112052
– hkotsubo
Please [Edit] and post the code as text. Then select and click the button
{}
editor to format.– bfavaretto