Trie class. Available member functions include default constructor, find, insert, checkPrefix and countPrefix.
More...
|
ll | count |
| count of the string from root to leaf
|
|
map< char, Trie * > | nodes |
| map/dictionary of nodes
|
|
Trie class. Available member functions include default constructor, find, insert, checkPrefix and countPrefix.
◆ checkPrefix()
bool Trie::checkPrefix |
( |
string |
s | ) |
|
|
inline |
Check if a string is a prefix.
- Parameters
-
- Returns
- true/false
◆ countPrefix()
ll Trie::countPrefix |
( |
string |
s | ) |
|
|
inline |
Count how many strings have the given prefix.
- Parameters
-
- Returns
- ll
◆ find()
bool Trie::find |
( |
Trie * |
T, |
|
|
char |
c |
|
) |
| |
|
inline |
Find a char in a trie.
- Parameters
-
[in] | T | trie root pointer |
[in] | c | char to find |
- Returns
- true/false
◆ insert()
void Trie::insert |
( |
string |
s | ) |
|
|
inline |
Insert string into a trie.
- Parameters
-
The documentation for this class was generated from the following file: