修改命名错误
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
#include "../TrieTree.h"
|
#include "../TrieTree.h"
|
||||||
|
|
||||||
namespace TinySTL{
|
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(){
|
trie_tree::~trie_tree(){
|
||||||
if (data){
|
if (root_){
|
||||||
data->map_childs.clear();
|
root_->map_childs.clear();
|
||||||
delete data;
|
delete root_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool trie_tree::empty()const{
|
bool trie_tree::empty()const{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace TinySTL{
|
|||||||
typedef string value_type;
|
typedef string value_type;
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
private:
|
private:
|
||||||
trie_node *data;
|
trie_node *root_;
|
||||||
size_type size_;
|
size_type size_;
|
||||||
public:
|
public:
|
||||||
trie_tree();
|
trie_tree();
|
||||||
@@ -41,7 +41,7 @@ namespace TinySTL{
|
|||||||
bool is_existed(const string& word)const;
|
bool is_existed(const string& word)const;
|
||||||
private:
|
private:
|
||||||
node_ptr make_node(char ch, bool is_a_word);
|
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 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 __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;
|
void _print_tree(std::ostream& os, const node_ptr& up, string word)const;
|
||||||
|
|||||||
Reference in New Issue
Block a user