TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
trie_modern.cpp File Reference

A basic implementation of trie class to store only lower-case strings. More...

#include <iostream>
#include <memory>
#include <string>
Include dependency graph for trie_modern.cpp:

Go to the source code of this file.

Classes

class  Trie
 
struct  Trie::TrieNode
 

Functions

int main ()
 

Detailed Description

A basic implementation of trie class to store only lower-case strings.

Author
Anmol3299

Definition in file trie_modern.cpp.

Function Documentation

◆ main()

int main ( void )

Main function

Definition at line 160 of file trie_modern.cpp.

160 {
161 Trie trie;
162 trie.insert("hel");
163 trie.insert("hello");
164 trie.removeWord("hel");
165 std::cout << trie.search("hello") << '\n';
166
167 return 0;
168}
bool search(const std::string &word)
void insert(const std::string &word)