Why not use heap sort always [duplicate]
This question already has an answer here: Quicksort vs heapsort 11 answers Quicksort superiority over Heap Sort 5 answers The Heap Sort sorting algorithm seems to have a worst case complexity of O(nlogn), and uses O(1) space for the sorting operation. This seems better than most sorting algorithms. Then, why wouldn't one use Heap Sort always as a sorting algorithm (and why do folks use sorting mechanisms like Merge sort or Quick sort)? Also, I have seen people use the term 'instability' with Heap sort. What does that imply? A stable sort maintains the relative order of items that have the same