title: Kth largest element in a max-heap
body: <p>I'm trying to come up with something to solve the following:</p>
  
  <blockquote>
    <p>Given a max-heap represented as an array, return the kth largest element without modifying the heap. I was asked to do it in linear time, but was told it can be done in log time.</p>
  </blockquote>
  
  <p>I thought of a solution:</p>
  
  <p>Use a second max-heap and fill it with k or k+1 values into it (breadth first traversal into the original one) then pop k elements and get the desired one. I suppose this should be O(N+logN) = O(N)</p>
  
  <p>Is there a better solution, perhaps in O(logN) time?</p>