title: Binary Search Tree Small Count Exercise
body: <p>I'm trying to write a method that does the following:
  Given a BST, write a recursive function BSTsmallcount that, given a key value, returns the number of nodes having values less than the key. Your function should visit as few nodes in the BST as possible.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>public int BSTsmallcount(BinNode root, int key)
  {
      int count = 0;
      if (root.right &lt; key)
      {
          count += BSTsmallcount(root.left, key);
      }
      if (root.left &lt; key)
      {
          count += BSTsmallcount(root.right, key);
      }
      return count;
  
  }
  </code></pre>
  
  <p>However this is incorrect because you can't use binary operators. How would I complete this problem?</p>