title: What would cause an algorithm to have O(log n) complexity?
body: <p>My knowledge of big-O is limited, and when log terms show up in the equation it throws me off even more.  </p>
  
  <p>Can someone maybe explain to me in simple terms what a <code>O(log n)</code> algorithm is? Where does the logarithm come from?</p>
  
  <p>This specifically came up when I was trying to solve this midterm practice question:</p>
  
  <blockquote>
    <p>Let X(1..n) and Y(1..n) contain two lists of integers, each sorted in nondecreasing order. Give an O(log n)-time algorithm to find the median (or the nth smallest integer) of all 2n combined elements.  For ex, X = (4, 5, 7, 8, 9) and Y = (3, 5, 8, 9, 10), then 7 is the median of the combined list (3, 4, 5, 5, 7, 8, 8, 9, 9, 10). [Hint: use concepts of binary search]</p>
  </blockquote>