I want to improve the runtime of my code when traversing the Trie. for my BFS traversal I've been checking every letter in the alphabet for the child nodes'. Is there a way we utilize getChildrenMap to retrieve only the existing nodes? That way I don't have to check every letter.
If creating the TrieTree using given dict.txt, the TrieTree could be a tree that has limited child nodes. Then during traversal, it already saves some time. Does it help?
I want to improve the runtime of my code when traversing the Trie. for my BFS traversal I've been checking every letter in the alphabet for the child nodes'. Is there a way we utilize getChildrenMap to retrieve only the existing nodes? That way I don't have to check every letter.