title: In Big-O notation for tree structures: Why do some sources refer to O(logN) and some to O(h)?
body: <p>In researching complexity for any algorithm that traverses a binary search tree, I see two different ways to express the same thing:</p>
  
  <p>Version #1: The traversal algorithm at worst case compares once per height of the tree; therefore complexity is <code>O(h)</code>.</p>
  
  <p>Version #2: The traversal algorithm at worst case compares once per height of the tree; therefore complexity is <code>O(logN)</code>.</p>
  
  <p>It seems to me that the same logic is at work, yet different authors use either <code>logN</code> or <code>h</code>. Can someone explain to me why this is the case?</p>