title: insert on first BST giving end of no-void function errror?
body: <p>So I am attempting to learn how to code my first BST, and it is hard.... I am already having trouble with just a few lines of codes. the problem is in the insert, but I have included everything so that I could get some feedback on my style/other errors.  I was suggested to use a pointer to pointer implementation, but we havent learned it yet, so I dont feel comfort/know how to code it yet. the </p>
  
  <p>error is </p>
  
  <pre><code>cc1plus: warnings being treated as errors
  tree.cpp: In member function âbool Tree::insert(Tree::Node*&amp;, int, std::string)â:
  tree.cpp:34: warning: control reaches end of non-void function
  </code></pre>
  
  <p>the tree.h file</p>
  
  <pre><code>#ifndef TREE_H
  #define TREE_H
  
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  class Tree
  {
   public:
    Tree();
    bool insert(int k, string s);
  
   private:
    struct Node
    {
      int key;
      string data;
      Node* left;
      Node* right;
    };
    Node* root;
    bool insert(Node*&amp; root, int k, string s);
  };
  
  #endif
  </code></pre>
  
  <p>tree.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "tree.h"
  #include &lt;stack&gt;
  #include &lt;queue&gt;
  #include &lt;string&gt;
  using namespace std;
  
  Tree::Tree()
  {
    root = NULL;
  }
  
  bool Tree::insert(int k, string s)
  {
    return insert(root, k, s);
  }
  
  bool Tree::insert(Node*&amp; currentRoot, int k, string s)
  {
    if(currentRoot == NULL){
      currentRoot = new Node;
      currentRoot-&gt;key = k;
      currentRoot-&gt;data = s;
      currentRoot-&gt;left = NULL;
      currentRoot-&gt;right = NULL;
      return true;
    }
    else if (currentRoot-&gt;key == k)
      return false;
    else if (currentRoot-&gt;key &gt; k)
      insert(currentRoot-&gt;left, k, s);
    else
      insert (currentRoot-&gt;right,k, s);
  }
  </code></pre>
  
  <p>movieList.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stack&gt;
  #include &lt;queue&gt;
  #include &lt;string&gt;
  #include "tree.h"
  
  
  using namespace std;
  
  int main()
  {
    Tree test;
    test.insert(100, "blah");
    return 0;
  }
  </code></pre>