What is the space complexity of the HeapSort algorithm?

  • AO(1)
  • BO(2)
  • CO(3)
  • DNone of these
Show answerHide answer

Correct answer A

Heap Sort is an in-place sorting algorithm, meaning it does not require extra arrays. All operations are performed within the original array. Therefore, its space complexity is constant, O(1).