#ifndef TRIE_H #define TRIE_H #include template struct trie_node { char c; T* value = NULL; trie_node* next = NULL; trie_node* child = NULL; trie_node (char c); trie_node (char c, trie_node* next, trie_node* child); // ~trie_node (); }; template std::ostream& operator<<(std::ostream&, trie_node* node); template struct trie { trie_node* root; trie (); // ~trie (); int push_back (const char* key, const T&); T& operator[] ( char* key ); bool empty () { return this->root->child == NULL; } }; template std::ostream& operator<<(std::ostream&, trie* trie); #endif /* TRIE_H */