Given the following problem , I\'m not completely sure with my current solution :
Question :
Given a maximum heap with n ele
n
Indeed, it is too easy, extracting the max element is O(log(N)) where N is the size of the heap. and N≠K.
O(log(N))
N
N≠K
I will add that searching for a random element is O(N) and not O(Log(N)), but in this case we want to extract the max.
O(N)
O(Log(N))