Heap Sort

Time Complexity

  • Best / Worst / Avg = O(nlogn) — construct heap cost O(n), remove_min() take O(logn). Therefore overall run time is always O(nlogn).
  • Best case of delete a single item = O(1)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License