title: Error Executing Trie Tree
body: <p>i want to insert a string and make a search opeartion using trie data structure.This is my first implementation using pointers so i am really confused what i am doing wrong in the code,It is giving compilation error.please help to debug it and please tell me what is wrong in my pointer logic.</p>
  
  <pre><code>typedef struct trie {
      unordered_multimap&lt;char, struct trie&gt; child;
      bool isEnd;
  } trie;
  trie* newtrienode()
  {
      trie* newnode = (trie*)malloc(sizeof(trie));
      newnode-&gt;isEnd = false;
      return newnode;
  }
  trie* root = newtrienode();
  void insert(string word)
  {
      trie* current = root;
      for (int i = 0; i &lt; word.length(); i++) {
          char ch = word[i];
          trie* node = current-&gt;child[ch];
          if (node == NULL) {
              trie* node = newtrienode();
              current-&gt;child.insert(pair&lt;char, trie&gt;(ch, node));
          }
          current = node;
      }
      current-&gt;isEnd = true;
  }
  bool search(string word)
  {
      trie* current = root;
      for (int i = 0; i &lt; word.length(); i++) {
          char ch = word[i];
          trie* node = current-&gt;child[ch];
          if (node == NULL) {
              return false;
          }
          current = node;
      }
      return true;
  }
  </code></pre>