title: Find max and min value of BST
body: <p>Hello stackoverflowers, 
  i am facing a problem with my function in C, i want to create a function that give me the min and max value in BST.
  The problem is when i use this function it returns the same value for min and max: </p>
  
  <pre><code>void Find_Min_Max(node *bt,int* maxint,int* minint)
  {
      node *tmp = bt;
      if( bt == NULL)
      {
          *maxint = 0;  // Only if the tree contains nothing at all
          *minint = 0;  // Only if the tree contains nothing at all
      }
     if( bt-&gt;left)
         return Find_Min_Max(bt-&gt;left,&amp;(*maxint),&amp;(*minint));
     *minint = bt-&gt;data;
     if( tmp-&gt;right)
         return Find_Min_Max(tmp-&gt;right,&amp;(*maxint),&amp;(*minint));
     *maxint = tmp-&gt;data;
  }
  </code></pre>
  
  <p>But when i use it to give me just one result max/min, i delete this part of code, everything work perfectly: </p>
  
  <pre><code>if( tmp-&gt;right)
      return Find_Min_Max(tmp-&gt;right,&amp;(*maxint),&amp;(*minint));
  *maxint = tmp-&gt;data;
  </code></pre>
  
  <p>Any idea how this will work?.
  Thank you in advance.</p>