Trie class. Available member functions include default constructor, find, insert, checkPrefix and countPrefix.
More...
#include <DSA.h>
|
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 | ) |
|
Check if a string is a prefix.
- Parameters
-
- Returns
- true/false
◆ countPrefix()
ll Trie::countPrefix |
( |
string |
s | ) |
|
Count how many strings have the given prefix.
- Parameters
-
- Returns
- ll
◆ find()
bool Trie::find |
( |
Trie * |
T, |
|
|
char |
c |
|
) |
| |
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 | ) |
|
Insert string into a trie.
- Parameters
-
The documentation for this class was generated from the following files: