title: Trimming a Binary Search Tree
body: <p>I am supposed to write a method that takes in two integers as a min and max. Then it removes any integers from the tree that are less than the minimum and larger than the maximum. The code I have so far is very ugly and does not work at all. I'm not even sure if it I am on the correct path or not...</p>
  
  <pre><code>private SearchTree&lt;Integer&gt; trim(SearchTreeNode&lt;Integer&gt; e, int min, int max){
      if (e != null){
          if (e.left.data.compareTo(min) &lt;= 0){
              remove((E) e.left);
          } else {
  
          }
      }
  }
  </code></pre>