Question

I am a mechanical student and I have changed my field to Computers. Need to get through the algorithms class. This question is one of the exercise questions

  1. If the max heap algorithm's running time is O(klogn) then is there any algorithm which has better running time than this?
Was it helpful?

Solution

  1. Print and remove the root k times;
  2. O(k log n);
  3. Yes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top