Skip to content

Instantly share code, notes, and snippets.

@bragboy
Created August 8, 2015 20:23
Show Gist options
  • Save bragboy/a77cb6aab2523ba95665 to your computer and use it in GitHub Desktop.
Save bragboy/a77cb6aab2523ba95665 to your computer and use it in GitHub Desktop.
int main()
{
trie mytrie;
char *s[] = {"tree","trie","algo","assoc","all","also","ass"};
for(int i=0;i<sizeof(s)/sizeof(*s);i++)
{
mytrie.insert_word(s[i]);
}
mytrie.display();
if(mytrie.search_word("all") == true) cout << "all exist" << endl;
else cout << "all do not exist" << endl;
mytrie.delete_word("all");
if(mytrie.search_word("all") == true) cout << "all exist" << endl;
else cout << "all do not exist" << endl;
mytrie.display();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment