What is the space complexity of the HeapSort algorithm?

Review the verified answer and explanation for this MOD - MINISTRY OF DEFENCE past-paper question on CampusFin.

What is the space complexity of the HeapSort algorithm? Answer: O(1)

The auxiliary space complexity of the HeapSort algorithm is O(1). If you include the memory required to hold the original input array itself, the total space complexity is O(n).

Question context

This question is part of 💡 C Programming within the broader 💻 Programming subject and appears in the MOD - MINISTRY OF DEFENCE preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.