Write trie.cpp and modify trie.h