title: Searching a binary tree for a specific word
body: <p>I need to find a given word in a binary tree. I have this code </p>
  
  <pre><code>if (n !=null)
  {
      if((name.compareTo(n.getVehicleName()) &lt; 0) &amp;&amp; n.left())
      {
          return find(name.hasLeft, n);
      }
      if((name.compareTo(n.getVehicleName()) &gt; 0) &amp;&amp; n.hasRight())
      {
          return find(name.right, n);
      }
      if(name.compareTo(n.getVehicleName()) == 0)
      {
          return Vehicle;
      }
  }
  </code></pre>
  
  <p>I doesn't work and I'm not sure how to solve it.</p>
  
  <p>The only help i was given was this:</p>
  
  <pre><code>* @param name  The name of the vehicle to search for
  * @param n     The current node in the tree to search from
  * @return      A reference to the node that was found or null if not found 
  
  int order = name.compareTo(n.getVehicleName());
  
  if(n==null) return null
  
  return null;
  </code></pre>