title: BST size() that looks pretty
body: <p>I have two functions here for size() but they both look like crap. The first one uses an overloaded function and the second, well, see for yourself. What I want to do is create a slick version of the second attempt but I'm low on ideas.</p>
  
  <p>P.S: Telling me to use Java's util is kind of pointless. I want to make it pretty, not hide it.</p>
  
  <p>So my function is called from a BST object and looks like this:</p>
  
  <pre><code> public int size() {
   return size(root);
   }
  
   private int size(Node x) {
   if (x == null) {
   return 0;
   } else {
   return 1 + size(x.left) + size(x.right);
   }
   } 
  </code></pre>
  
  <p>Now I don't want to overload the function so I rewrote it as such:</p>
  
  <pre><code>public int size() {
      Node y = root;
      if (y == null) {
          return 0;
      } else {
          root = y.left;
          int left = size();
          root = y.right;
          int right = size();
          root = y;
          return 1 + left + right;
      }
  }
  </code></pre>
  
  <p>All suggestions are welcome!</p>