Which sorting algorithms are unstable?
Quick Sort, Heap Sort etc., can be made stable by also taking the position of the elements into consideration. This change may be done in a way that does not compromise a lot on the performance and takes some extra space, possibly .
Stable and Unstable Sorting Algorithms
Stability is mainly essential when we have key-value pairs with duplicate keys possible (like people’s names as keys and their details as values). And we wish to sort these objects by keys.