X326: Binary Tree Leaf Nodes Count Exercise (Modified)

Write a recursive function to count the number of leaf nodes in the binary tree pointed at by root. You must use the isLeaf method to check if a node is a leaf, rather than check the value of the left and right child pointers.
Here are methods that you can use on the BinNode objects:
   interface BinNode {
      public int value();
      public void setValue(int v);
      public BinNode left();
      public BinNode right();
      public boolean isLeaf();
   }

Reset

Practice a different Java exercise