title: Finding the non leaves in a Binary tree
body: <p>I am trying to create a binary tree and try to count the non leaves in Java. How can I found the numbers of non leaves? Any suggestions please?
  here is a part of my code:</p>
  
  <pre><code>      public int no_leaves() 
          { BTNode&lt;Integer&gt; n = root; 
           int count=0; 
          while(n!=null ) 
          { 
          if((n.right==null)&amp;&amp; (n.left==null)) 
          {continue; 
  
          } 
          else
          { 
            count++; 
          } 
          } 
         System.out.println(count); 
        return count; 
        } 
  </code></pre>