title: Having trouble getting my Delete and DFS function to work properly
body: <p>I am trying to create a Tree data structure which stores information about the Olympic Venues. I have just run into a roadblock and I have realized that my delete function always returns "Element Not Found" and my DFS will find the correct node, but then continue to print out the right side of the tree.</p>
  
  <pre><code>Tree * preorder_find(char * find_city, Tree* T)
  {
      if(T)
      {
  
          //if(strcmp(T-&gt;Element-&gt;city, find_city) == 0)
          //return T;
  
          printf("%s, %s ... %d\n", T-&gt;Element-&gt;city, T-&gt;Element-&gt;country, 
                                                  T-&gt;Element-&gt;year);
  
          if(strcmp(T-&gt;Element-&gt;city, find_city) != 0)
          {   
              preorder_find(find_city, T-&gt;Left);
  
              preorder_find(find_city, T-&gt;Right);
          }
  
      }
  
  
  return T;
  
  }
  
  
  
  Tree* delete(char * venue, Tree* T)
  {
      Tree* tmp_node;
  
      if(T==NULL)
          fprintf(stderr, "Element not Found\n");
      else
      if(strcmp(venue, T-&gt;Element-&gt;city) &lt; 0)
          T-&gt;Left = delete(venue, T-&gt;Left);
      else
      if(strcmp(venue, T-&gt;Element-&gt;city) &gt; 0)
          T-&gt;Right = delete(venue, T-&gt;Left);
      else
      if(T-&gt;Left &amp;&amp; T-&gt;Right)
      {
          tmp_node = find_min(T-&gt;Right);
          T-&gt;Element = tmp_node-&gt;Element;
          T-&gt;Right = delete(T-&gt;Element-&gt;city, T-&gt;Right);
      }
      else
      {
          tmp_node = T;
          if(T-&gt;Left == NULL)
              T = T-&gt;Right;
          else if(T-&gt;Right == NULL)
              T = T-&gt;Left;
          free(tmp_node);
       }
  
       return T;
  }
  </code></pre>