AlgoPlus v0.1.0
Loading...
Searching...
No Matches
trie Class Reference

trie class More...

#include <trie.h>

Public Member Functions

 trie (std::vector< std::string > v={}) noexcept
 Construct a new trie object.
 
 trie (const trie &t)
 Copy constructor for trie class.
 
trieoperator= (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.
 

Friends

std::ostream & operator<< (std::ostream &out, trie &t)
 

Detailed Description

trie class

Constructor & Destructor Documentation

◆ 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
tthe tree we want to copy

Member Function Documentation

◆ empty()

bool trie::empty ( )
inline

empty function.

Returns
true if the trie is empty.

◆ insert()

void trie::insert ( std::string key)
inline

insert function.

Parameters
keythe key to be inserted.

◆ operator=()

trie & trie::operator= ( const trie & t)
inline

operator = for trie class

Parameters
tthe tree we want to copy
Returns
trie&

◆ remove()

void trie::remove ( std::string key)
inline

remove function.

Parameters
keythe key to be removed.

◆ search()

bool trie::search ( std::string key)
inline

search function.

Parameters
keythe key to be searched.
Returns
true if the word exist in the tree.

◆ size()

size_t trie::size ( )
inline

size function

Returns
size_t the size of the tree

The documentation for this class was generated from the following file: