提交 e50d7595 编写于 作者: 邹晓航

修改命名错误

上级 785a9727
#include "../TrieTree.h"
namespace TinySTL{
trie_tree::trie_tree():data(new trie_node), size_(0){}
trie_tree::trie_tree() :root_(new trie_node), size_(0){}
trie_tree::~trie_tree(){
if (data){
data->map_childs.clear();
delete data;
if (root_){
root_->map_childs.clear();
delete root_;
}
}
bool trie_tree::empty()const{
......
......@@ -24,7 +24,7 @@ namespace TinySTL{
typedef string value_type;
typedef size_t size_type;
private:
trie_node *data;
trie_node *root_;
size_type size_;
public:
trie_tree();
......@@ -41,7 +41,7 @@ namespace TinySTL{
bool is_existed(const string& word)const;
private:
node_ptr make_node(char ch, bool is_a_word);
inline trie_node* get_root()const{ return data; }
inline trie_node* get_root()const{ return root_; }
void _get_word_by_prefix(const string& prefix, const node_ptr& up, const string& real_prefix, vector<string>& words)const;
void __get_word_by_prefix(const node_ptr& up, string& word, const string& prefix, vector<string>& words)const;
void _print_tree(std::ostream& os, const node_ptr& up, string word)const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册