Why is Selection Sort not stable?

前端 未结 3 614
遥遥无期
遥遥无期 2021-01-30 04:12

This might be trivial, but I don\'t understand why the default implementation of Selection Sort is not stable?

At each iteration you find the minimum element in the rema

3条回答
  •  长情又很酷
    2021-01-30 04:56

    Stable means does not calculate further if elements is already sorted, but it calculate till end hence it is not stable.

提交回复
热议问题