Stable sort algorithms sort equal elements in the same order that they appear in the input.

(“Sorting Algorithm” 2022)

stable_sort([10_1, 8_1, 3_1, 8_2])
> [3_1, 8_1, 8_2, 10_1]

Unstable sorting algorithm

unstable_sort([10_1, 8_1, 3_1, 8_2])
> [3_1, 8_2, 8_1, 10_1]

References


Links to this note