title: Extracting median from databases of n entries using O(log n) queries
body: <p>Suppose I have two databases each containing <code>n</code> entries. Define median to be the <code>n</code>'th smallest value. We can extract one value, at a time, from a given database through query.</p>
  
  <p><code>Query(k)</code> returns <code>k</code>'th smallest value of the database specified. How can you find the median using at most <code>O(log n)</code> queries ?</p>