diff --git a/include/trie.h b/include/trie.h new file mode 100644 index 0000000..fdbf7ce --- /dev/null +++ b/include/trie.h @@ -0,0 +1,28 @@ + +#include +using namespace std; + +class trieNode { + public: + char data; + bool isTerminating; + trieNode** child; + + public: + trieNode(char data){ + this->data = data; + isTerminating = false; + child = new trieNode*[26]; + for(int i=0; i<26; i++) + child[i] = NULL; + } +}; + +class trie{ + private: + trieNode* node; + + trie(){ + node = new trieNode('\0'); + } +}; \ No newline at end of file