Function to test a simple search before and after deleting an entry. And to test out the multiple variants of search.
425 {
428 "abcde", "sss", "ssss", "ssst", "sssu", "sssv",
429 "sst", "ssts", "sstt", "sstu", "tutu", "tutuv",
430 "tutuu", "tutuvs", "tutus", "tvst", "tvsu", "vvvv"};
431
432 for (auto &i : inputs) {
433 root->Insert(i);
434 }
435
436 assert(root->SearchPresence("vvvv"));
438
439 root->Delete("vvvv");
440
441 assert(!root->SearchPresence("vvvv"));
443
445 root->SearchSuggestions("tutu");
447
448 root->SearchSuggestions("tutuv");
450
451 root->SearchSuggestions("tutuvs");
452
453 root->SearchFreqSuggestions(
454 "tu");
455
456 root->SearchSuggestions(
457 "");
458}
Class defining the structure of trie node and containing the methods to perform operations on them.
Definition trie_multiple_search.cpp:37