You are viewing a single comment's thread. Return to all comments →
I solved this by returning from the add operation if the string already exists in the trie.
void add(string str) { if (find(str) != 0) { return; } ... }
Seems like cookies are disabled on this browser, please enable them to open this website
Tries: Contacts
You are viewing a single comment's thread. Return to all comments →
I solved this by returning from the add operation if the string already exists in the trie.