Why is space complexity of heap sort is O(1)? Everytime it calls Heapify() function at the root node of the heap and heapify in the worst case takes O(log n) space. Then why everywhere its written that heapsort is inplace sorting algorithm??
Another doubt is that what should be amswered in space complexity of an algorithm? The auxiliary space or the total space which include the input size as well??