title: Inserting an element in Binary Tree
body: <p>Tried exploring a lot over the net, but could get any help,
  Everywhere its like adding a node to the Binary Search tree.</p>
  
  <p>Question: Requesting for algorithm and code snippet for adding a node to the <strong>Binary tree</strong>. ( or point me to correct URL )</p>
  
  <p>Assumption:
  As per my understanding, <strong>Binary Tree</strong> and <strong>Binary Search Tree</strong> is different? Correct me if I am wrong. </p>
  
  <p>( request: if you are writing your code snippet please use proper variable name, that helps in understanding )</p>
  
  <p>Eg: Binary Tree</p>
  
  <p>5 7 3  x1 x2 x3  </p>
  
  <pre><code>                 5
  
            7               3
  
     x1       x2       x3       
  </code></pre>
  
  <p>Binary Search Tree    5 7 3 2 4 6 </p>
  
  <pre><code>                   5
            3               7
  
     2          4       6       
  
  
  
  
  
  insert(int key, struct node **root)
  {
      if( NULL == *root )`
      {
          *root = (struct node*) malloc( sizeof( struct node ) );`
          (*root)-&gt;data = key;
          (*root)-&gt;left = NULL;    
          (*root)-&gt;right = NULL;  
      }
      else if(key &lt; (*root)-&gt;data)
      {
          insert( key, &amp;(*root)-&gt;left );
      }
      else if(key &gt; (*root)-&gt;data)
      {
          insert( key, &amp;(*root)-&gt;right );
      }
  }
  </code></pre>