From 077b40de54c314e7060838870a38b7270b5ce0d1 Mon Sep 17 00:00:00 2001 From: gwdwyy Date: Thu, 4 Jul 2013 23:33:16 +0800 Subject: [PATCH] replace hash_map with map ,because hash_map use 10 times memory than map --- Trie.cpp | 7 ++++--- Trie.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Trie.cpp b/Trie.cpp index de26d24..42d3cbc 100644 --- a/Trie.cpp +++ b/Trie.cpp @@ -177,10 +177,11 @@ using namespace CppJieba; int main() { Trie trie; - trie.init("test/dict.txt"); - cout<count<count< #include -#include +//#include +#include #include #include "cppcommon/str_functs.h" #include "cppcommon/vec_functs.h" @@ -14,9 +15,9 @@ namespace CppJieba { using namespace CPPCOMMON; using namespace std; - using __gnu_cxx::hash_map; + //using __gnu_cxx::hash_map; typedef uint16_t ChUnicode; - typedef hash_map TrieNodeHashMap; + typedef map TrieNodeHashMap; struct TrieNode {