We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I implemented my code using Trie with array of size 26 but only 2 test cases are passed. Can anyone help?
class TrieNode{
public:
char data;
TrieNode **children;
bool isTerminal;
TrieNode(char data){
this->data = data;
children = new TrieNode*[26];
for(int i = 0; i < 26; i++){
children[i] = NULL;
}
isTerminal = false;
}
Contacts
You are viewing a single comment's thread. Return to all comments →
};
class Trie{ TrieNode *root;
};
vector contacts(vector> queries) { vector result; Trie *trie = new Trie();
}