trie class
More...
#include <trie.h>
|
| trie (std::vector< std::string > v={}) noexcept |
| Construct a new trie object.
|
|
| trie (const trie &t) |
| Copy constructor for trie class.
|
|
trie & | operator= (const trie &t) |
| operator = for trie class
|
|
bool | empty () |
| empty function.
|
|
void | insert (std::string key) |
| insert function.
|
|
size_t | size () |
| size function
|
|
void | remove (std::string key) |
| remove function.
|
|
bool | search (std::string key) |
| search function.
|
|
|
std::ostream & | operator<< (std::ostream &out, trie &t) |
|
◆ trie() [1/2]
trie::trie |
( |
std::vector< std::string > | v = {} | ) |
|
|
inlineexplicitnoexcept |
Construct a new trie object.
- Parameters
-
v | : vector of strings for initializer. |
◆ trie() [2/2]
trie::trie |
( |
const trie & | t | ) |
|
|
inlineexplicit |
Copy constructor for trie class.
- Parameters
-
t | the tree we want to copy |
◆ empty()
empty function.
- Returns
- true if the trie is empty.
◆ insert()
void trie::insert |
( |
std::string | key | ) |
|
|
inline |
insert function.
- Parameters
-
key | the key to be inserted. |
◆ operator=()
trie & trie::operator= |
( |
const trie & | t | ) |
|
|
inline |
operator = for trie class
- Parameters
-
t | the tree we want to copy |
- Returns
- trie&
◆ remove()
void trie::remove |
( |
std::string | key | ) |
|
|
inline |
remove function.
- Parameters
-
key | the key to be removed. |
◆ search()
bool trie::search |
( |
std::string | key | ) |
|
|
inline |
search function.
- Parameters
-
key | the key to be searched. |
- Returns
- true if the word exist in the tree.
◆ size()
size function
- Returns
- size_t the size of the tree
The documentation for this class was generated from the following file:
- /Users/runner/work/AlgoPlus/AlgoPlus/src/classes/tree/trie.h