/* * suffix_tree.h * * Created on: May 17, 2010 * Author: Vlad */ #ifndef SUFFIX_TREE_H_ #define SUFFIX_TREE_H_ #include #include #include template class Node { public: std::map edge_list_; int InsertPath(const std::vector& p, int start, int end); const Node* Extend(const T& e) const { typename std::map::const_iterator it = edge_list_.find(e); if (it == edge_list_.end()) return NULL; return &it->second; } }; bool DEBUG = false; template int Node::InsertPath(const std::vector& p, int start, int end){ Node* currNode = this; for(int i=start;i<= end; i++ ) { currNode = &(currNode->edge_list_)[p[i]]; } return 1; } #endif /* SUFFIX_TRIE_H_ */