Good morning, I'm presenting a problem that I have no idea why, I've tried to ask other people, none have discovered the real reason for the error and how to fix it. Well my teacher, asked to implement a system with which opens a txt file that contains words and these words should be stored in a tree trie. The implementation of this tree with a test is available at: link
In this way, the implementation of this tree is very close to what needs to be done, since through a string array the words are inserted in the tree. Below the main function of the implementation that I provided the link, the output of this program is correct, indicating that there is no word "these" and there is the word "the"
[
SobasicallyIadaptedthecodebyreadingthetxtfileanditdidnotwork,Ibelievethattheproblemmayberelatedtotheinsertmethod.Ididatesttoo,printingallthewordsinthefileandthankfullyitworked,ortheproblemisjustenteringthewords
It does not make sense that all words are right as you go. And at the time of saying whether or not that word in the tree does not work, I used the same implementation that was working correctly. Thank you very much if anyone knows what I did wrong