Stability and Instability on sorting algorithms

1, a stable sorting algorithm: This simply means that, to ensure that they have the same two positions before and after the order of the sorting order and relative position equal to the number after two sequences located before sorting. If A1 = A2, A1 position in front of the original, sorted A1 or A2 position held before.

 

2, unstable sorting algorithm: sort occur before and after the relative position in the sequence.

Guess you like

Origin www.cnblogs.com/stupid-chan/p/11223504.html