I was asked in an interview:
What is the best time complexity in getting the min element(s) from a max-heap?
I replied as O(1) a
Min element from Max heap :
search at last level = O(n/2)= O(n)
replace searched element with last element and decrease heap size by 1 = O(1)
Apply Maxheapify on replaced element = O(log n)
Total Time = O(n)+O(1)+O(log n) = O(n)