Stabilizing the standard library qsort?

No, you cannot rely on that unfortunately. Let’s assume you have the array (two fields in each record used for checking but only first field used for sorting): B,1 B,2 A,3 A non-stable sort may compare B,1 with A,3 and swap them, giving: A,3 B,2 B,1 If the next step were to compare B,2 with … Read more