title: Searching the 7th largest element in a max-heap?
body: <p>So my friend and I are not seeing eye to eye in this question. It asks for the time complexity of searching for the 7th largest element in a max-heap of n elements?</p>
  
  <p>I'm of the opinion that it should be O(n) and she is of the opinion it should be O(1). My logic is that suppose n is 7 then 7th largest element will be the last element in the heap so if we consider the worst case it should be O(n). She however says that since it's a max heap so finding the 7th largest element should take constant time. But using her logic even the 50th largest element or the 100th largest element can be found in O(1) time.
  Also the book in which we came across this question says the solution will be O(logn). </p>
  
  <p>Can someone please tell me which solution is correct?</p>