title: Simple binary tree question
body: <p>I was wanting to display all of the nodes at a certain level in the tree:</p>
  
  <p>Called by: <code>allNodesAtACertainLevel(0, *whatever level you want*, root);</code></p>
  
  <p>This produces the correct answer.</p>
  
  <pre><code>private void allNodesAtACertainLevel(int count, int level, Node n){
  
          count += 1;
  
          if(count &lt;= level){
              if(n.left != null) allNodesAtACertainLevel(count, level, n.left);
              if(n.right != null) allNodesAtACertainLevel(count, level, n.right);
          }
          else{
              System.out.print(n.value);
          }
  
      }
  </code></pre>
  
  <p>This doesn't.</p>
  
  <pre><code>private void allNodesAtACertainLevel(int count, int level, Node n){
  
          if(count &lt; level){
              if(n.left != null) allNodesAtACertainLevel(count++, level, n.left);
              if(n.right != null) allNodesAtACertainLevel(count++, level, n.right);
          }
          else{
              System.out.print(n.value);
          }
  
      }
  </code></pre>
  
  <p>Could someone explain why?</p>