title: Binary Tree - Counting nodes on a level
body: <p>I'm writing a binary tree class, and I'm stuck on a levelCount method, where I need to count the number of nodes on a level of the tree.  The class and method look something like this:</p>
  
  <pre><code>public class ConsTree&lt;T&gt; extends BinaryTree&lt;T&gt;
  {
     BinaryTree&lt;T&gt; left;
     BinaryTree&lt;T&gt; right;
     T data;
  
     public int levelCount(int level) 
     {
     }
  }  
  </code></pre>
  
  <p>So the idea is that each tree has a tree to its left, a tree to its right, and data.  There is an abstract class binarytree and subclasses ConsTree and EmptyTree.</p>
  
  <p>I think I need to use a breadth first search and count the number of nodes once I get to that level, but I'm stuck on how to start.  Any guidance here would be helpful.  I can provide any other info necessary. </p>