diff --git a/include/suffix_tree.h b/include/suffix_tree.h index d738d9c3..7fd684e6 100644 --- a/include/suffix_tree.h +++ b/include/suffix_tree.h @@ -31,8 +31,6 @@ class SuffixTree template Iterator inc_search(Iterator sub) { - typedef typename Iterator::value_type T; // extract real type - Iterator result = sub; Node* node = &root; Edge* edge = NULL; @@ -73,13 +71,7 @@ class SuffixTree return result; } - int print_tree(void); -private: - string test_str; - struct Node; - typedef struct Node Node; - struct Edge{ // the begin and end pos of this edge, note that INT_MAX stands for #(the changing end pos of this entire string) unsigned int begin, end; @@ -146,7 +138,6 @@ class SuffixTree bool is_none(void) { return begin == 0 && end == 0; } }; - typedef struct Edge Edge; struct Node{ string& test_node_str; @@ -224,10 +215,9 @@ class SuffixTree return os; } }; - //typedef struct Node Node; - - friend struct Node; - + int print_tree(void); +private: + string test_str; class ActivePoint{ public: Node* active_node; diff --git a/src/suffix_tree_demo.cpp b/src/suffix_tree_demo.cpp index d4425c68..4a5170b5 100644 --- a/src/suffix_tree_demo.cpp +++ b/src/suffix_tree_demo.cpp @@ -104,7 +104,7 @@ int SuffixTree::construct(void) return 0; } -SuffixTree::Node* SuffixTree::seperate_edge(Node * node, Edge* a_edge) +SuffixTree::Node* SuffixTree::separate_edge(Node * node, Edge* a_edge) { cout << "separate the old edge here: " << (*a_edge) << endl; int new_begin = a_edge->begin + get_active_length();