title: Printing BST keys in the given range
body: <p>I am trying to understand the runtime of printing BST keys in the given range. 
  I tried to understand it from <a href="http://prpds.blogspot.com/2011/07/print-bst-keys-in-given-range.html" rel="nofollow">this example</a>, but I could not.</p>
  
  <p>I think I understand where the <code>O(log n)</code> is coming from. That is from going through the BST recursively, this will take <code>O(log n)</code> for each side, but I am not sure about:</p>
  
  <ol>
  <li><p>Where the <code>K</code> is coming from. is it just the constant time it takes to print? if yes why is the runtime not <code>O(log n)</code> + <code>O(k)</code> , and than you would ignore the K</p></li>
  <li><p>Where is the <code>O(n)</code> from the in order traversal? because it is not in this runtime. </p></li>
  <li><p>How the runtime will change if we have several values in the range on each side of the tree. For example, what if the range was from 4?</p></li>
  </ol>