Heapsort

A sorting technique that uses a binary heap, first building a max-heap and then repeatedly extracting the maximum element, ensuring efficient sorting.

  • Time complexity is Linearithmic, i.e. O(n log(n))
  • Space complexity is Constant, i.e. O(1)