What property of a sorting algorithm ensures that the relative order of equal elements is preserved?
Show answer
Stability
Stable sorts, such as Merge Sort and Insertion Sort, are crucial when sorting data by multiple keys. Unstable sorts, such as Quicksort and Heapsort, do not guarantee the preservation of the original relative order of identical elements.
Also asked as:
- What term describes a sorting algorithm that does not change the relative order of records with equal keys?