Implementation of Trie data structure for English alphabets in small characters.
More...
#include <array>
#include <cassert>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
|
static void | test () |
| Testing function.
|
|
int | main () |
| Main function.
|
|
Implementation of Trie data structure for English alphabets in small characters.
- Author
- @Arctic2333
-
Krishna Vedala
- Note
- the function ::data_structure::trie::deleteString might be erroneous
- See also
- trie_modern.cpp
◆ main()
Main function.
- Returns
- 0 on exit
205 {
207
208 return 0;
209}
static void test()
Testing function.
Definition trie_tree.cpp:178
◆ test()
Testing function.
- Returns
- void
178 {
180 root.insert("Hello");
181 root.insert("World");
182
183 assert(!root.search("hello", 0));
184 std::cout <<
"hello - " << root.search(
"hello", 0) <<
"\n";
185
186 assert(root.search("Hello", 0));
187 std::cout <<
"Hello - " << root.search(
"Hello", 0) <<
"\n";
188
189 assert(!root.search("Word", 0));
190 std::cout <<
"Word - " << root.search(
"Word", 0) <<
"\n";
191
192 assert(root.search("World", 0));
193 std::cout <<
"World - " << root.search(
"World", 0) <<
"\n";
194
195
196
197
198
199}
Trie implementation for small-case English alphabets a-z
Definition trie_tree.cpp:25