class TrieNode public Unistring data bool isFinal std map unichar Trie

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class TrieNode
{
public:
Unistring *data;
bool isFinal;
std::map<unichar, TrieNode*> leaves;
TrieNode(Unistring *ndata, std::map<unichar, TrieNode*> nleaves, bool nflag);
~TrieNode();
void findDownNodes(std::set<Unistring> wordSet);
void searchWordsFromNode(std::set<Unistring> *wordSet, Unistring *pattern, int curIndex);
};
class Trie
{
public:
TrieNode *root;
Trie(TrieNode *nroot);
~Trie();
std::set<Unistring> *searchWordsFromTrie(Unistring *pattern);
};