Efficiency improvment by using map instead of vector to keeping children in PathTrie
panmareksadowski opened this issue · 0 comments
panmareksadowski commented
Hi,
I think using std::unordered_map<int, PathTrie*> instead of std::vector<std::pair<int, PathTrie*>> could increase efficiency of adding and removing nodes from PathTrie.
Map should be specially more efficient when using larger alphabet(e.g. bigrams instead of letters).
Is there any reason why using vector to keeping node children is better than using unordered_map or map?