Trie (prefix-tree) implementation in C++