Will this piece of code for binary tree cause any issue?
<p>I have written a piece of code and it runs fine on my system. I am not having any issue, but I have a few concerns, which I am listing below. I would like to know if there is a real issue.</p>

<pre><code># include &lt;iostream&gt;
# include &lt;stdio.h&gt;
# include&lt;conio.h&gt;
using namespace std;

struct tree
{
  int data;
  struct tree * left;
  struct tree * right;
};

struct tree * insert(struct tree * root,int value)
{
     if(root==NULL)
     {
      struct tree *node=(struct tree *)malloc(sizeof(struct tree));
      node-&gt;data = value;
      node-&gt;left=NULL;
      node-&gt;right=NULL;
      return node;
     }
     else if(root-&gt;data &gt; value)
       root-&gt;left=insert(root-&gt;left,value);
     else {
       root-&gt;right=insert(root-&gt;right,value);
       /*return root;*/  // code works fine for me without this return
     }
}

void display(struct tree * root)
{ 
    if (root!=NULL)
    {
      display(root-&gt;left);
      cout &lt;&lt; "value is : " &lt;&lt; root-&gt;data &lt;&lt; " \n";
      display(root-&gt;right);
    }
}

int main()
{
   struct tree* root=NULL;
   root=insert(root,8);
   insert(root,6);
   insert(root,5);
   insert(root,2);
   insert(root,1);
   insert(root,7);
   insert(root,15);
   display(root);
   delete root;
   getch();
}
</code></pre>

<p>My code works fine without the <code>return root</code> statement in the insert function. The thing that worries me is that I am not returning anything during the recursive calls between the creation of the root and the insertion of the final element in this recursive function. But things are still all fine for me.</p>

<p>Can this become a problem in the future in more complex coding scenarios? </p>
