Skip to content

Commit e9a8007

Browse files
committed
issue xtaci#46 :
include/suffix_tree.h : - fixed build errors ( access modifiers issue) - removed typedef struct ... as it is unnecessary in C++ src/suffic_tree_demo.cpp : - fixed typo in function declaration name (seperate -> separate)
1 parent 508dc71 commit e9a8007

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

include/suffix_tree.h

+3-13
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class SuffixTree
3131
template <class Iterator>
3232
Iterator inc_search(Iterator sub)
3333
{
34-
typedef typename Iterator::value_type T; // extract real type
35-
3634
Iterator result = sub;
3735
Node* node = &root;
3836
Edge* edge = NULL;
@@ -73,13 +71,7 @@ class SuffixTree
7371
return result;
7472
}
7573

76-
int print_tree(void);
77-
private:
78-
string test_str;
79-
8074
struct Node;
81-
typedef struct Node Node;
82-
8375
struct Edge{
8476
// the begin and end pos of this edge, note that INT_MAX stands for #(the changing end pos of this entire string)
8577
unsigned int begin, end;
@@ -146,7 +138,6 @@ class SuffixTree
146138

147139
bool is_none(void) { return begin == 0 && end == 0; }
148140
};
149-
typedef struct Edge Edge;
150141

151142
struct Node{
152143
string& test_node_str;
@@ -224,10 +215,9 @@ class SuffixTree
224215
return os;
225216
}
226217
};
227-
//typedef struct Node Node;
228-
229-
friend struct Node;
230-
218+
int print_tree(void);
219+
private:
220+
string test_str;
231221
class ActivePoint{
232222
public:
233223
Node* active_node;

src/suffix_tree_demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int SuffixTree::construct(void)
104104
return 0;
105105
}
106106

107-
SuffixTree::Node* SuffixTree::seperate_edge(Node * node, Edge* a_edge)
107+
SuffixTree::Node* SuffixTree::separate_edge(Node * node, Edge* a_edge)
108108
{
109109
cout << "separate the old edge here: " << (*a_edge) << endl;
110110
int new_begin = a_edge->begin + get_active_length();

0 commit comments

Comments
 (0)