title: Java : Count even values in a Binary Search Tree recursively
body: <p>I need to find out how many even values are contained in a binary tree.</p>
  
  <p>this is my code.</p>
  
  <pre><code>private int countEven(BSTNode root){
  
  if ((root == null)|| (root.value%2==1))
  return 0;
  
  return 1+ countEven(root.left) + countEven(root.right);
  
  
  }
  </code></pre>
  
  <p>this i just coded as i do not have a way to test this out. I'm not able to test it out at the moment but need an answer so badly.
  any help is deeply appreciated.</p>