int findmaxprefix string pattern int patternlength string edge int edg

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
int findmaxprefix(string pattern, int patternlength, string edge, int edgelength, int skiplength)
{
for (int k = 0; k < patternlength; k++) {
if (k == (edgelength + skiplength) || pattern[k] != edge[k + skiplength] || pattern[k] == '*') {
return k;
}
}
return patternlength;
}
void print_data_array(void * data)
{
for (auto it = data.cbegin(); it != data.cend(); ++it) {
cout << *it << ' ';
}
cout << "\n";
}
list<nodes> findnodestotry(map<string, node>)
{
}
void search(string word)
{
if (word.empty()) {
if (endPoint) {
//printf("stored data:%s\n", data);
print_data_array(data);
} else
{
for (auto it = leaves.cbegin(); it != leaves.cend(); ++it) {
(*it).second.get("");
}
}
}
list<nodes> nodestotry = findnodestotry(leaves, word);
}