首页 > 其他 > 详细

Sorting Algorithms

时间:2019-03-10 10:52:23      阅读:154      评论:0      收藏:0      [点我收藏+]

Reference

[1] https://www.geeksforgeeks.org/stable-quicksort/

Stability

sorting algorithm is said to be stable if it maintains the relative order of records in the case of equality of keys.

Some sorting algorithms are stable by nature like Insertion sortMerge SortBubble Sort, etc. And some sorting algorithms are not, like Heap SortQuick Sort, etc.
QuickSort is an unstable algorithm because we do swapping of elements according to pivot’s position (without considering their original positions).

If Swap is every expensive, better stability is expected.

 

技术分享图片

Sorting Algorithms

原文:https://www.cnblogs.com/codingforum/p/10504080.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!