Write an algorithm to remove an arbitrary element from a heap of size \( N \). What is the running time of the algorithm? Give an example.
For Max-heap,
Time complexity of the algorithm is \( O(logN) \). Example - Priority queue of scheduled jobs and somebody cancels one of the jobs. |