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