AALanguage
The best language for those who have nothing to do
|
Trie-node class. More...
#include <Trie.h>
Public Member Functions | |
TrieNode () | |
Default constructor. | |
TrieNode (char c) | |
Constructor specifying the symbol of the current node. | |
~TrieNode () | |
Destructor. | |
char | get_char () |
Gets the symbol of the current node. | |
std::map< char, TrieNode * > * | get_next () |
Gets transitions to child nodes. | |
int * | get_ends () |
Gets the number of strings ending in the given node. | |
int * | get_count () |
Gets the number of strings ending in subtrees. | |
Private Attributes | |
char | _curr_char |
std::map< char, TrieNode * > | _next |
int | _ends |
int | _count |
Trie-node class.
The node stores within itself:
TrieNode::TrieNode | ( | ) |
Default constructor.
Definition at line 3 of file Trie.cpp.
References _count, _curr_char, and _ends.
TrieNode::TrieNode | ( | char | c | ) |
Constructor specifying the symbol of the current node.
c | Node symbol |
Definition at line 7 of file Trie.cpp.
References _count, _curr_char, and _ends.
TrieNode::~TrieNode | ( | ) |
char TrieNode::get_char | ( | ) |
Gets the symbol of the current node.
Definition at line 17 of file Trie.cpp.
References _curr_char.
int * TrieNode::get_count | ( | ) |
Gets the number of strings ending in subtrees.
Definition at line 26 of file Trie.cpp.
References _count.
Referenced by Trie::add(), and Trie::get_size().
int * TrieNode::get_ends | ( | ) |
Gets the number of strings ending in the given node.
Definition at line 23 of file Trie.cpp.
References _ends.
Referenced by Trie::add(), and Trie::find().
std::map< char, TrieNode * > * TrieNode::get_next | ( | ) |
Gets transitions to child nodes.
Definition at line 20 of file Trie.cpp.
References _next.
Referenced by Trie::add(), and Trie::find().
|
private |
Definition at line 61 of file Trie.h.
Referenced by get_count(), TrieNode(), and TrieNode().
|
private |
Definition at line 58 of file Trie.h.
Referenced by get_char(), TrieNode(), and TrieNode().
|
private |
Definition at line 60 of file Trie.h.
Referenced by get_ends(), TrieNode(), and TrieNode().
|
private |
Definition at line 59 of file Trie.h.
Referenced by get_next(), and ~TrieNode().