python的sorted()函数、列表的sort()方法,都是稳定的。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaotao_1/article/details/82534445

python的sorted()函数、列表的sort()方法,都是稳定的。即排序不改变相同元素的前后关系。

The built-in sorted() function is guaranteed to be stable. A sort is stable if it guarantees not to change the relative order of elements that compare equal — this is helpful for sorting in multiple passes

猜你喜欢

转载自blog.csdn.net/xiaotao_1/article/details/82534445