摘要
快速排序算法与其他算法相比是相当有效的排序算法,但此算法并不完善,它是不稳定的。为此,对快速排序算法进行改进,在每次对数据分割时,对需要移动的数据先分别顺序拷出并保存,分割结束前再按要求分别顺序拷入,使得新排序算法是稳定算法。理论分析和实验数据表明,在任何情况下,稳定快速排序算法都是稳定的,并且其他性能不比快速排序算法和归并算法差。
Quick sort algorithm is a more efficient one than other algorithms, but it is imperfect for its instability. Therefore, we improve the quick sort algorithm. At each time when the data is segmented, the new sort algorithm copies out and saves the data to be shifted in order separately, and then copies in them in order according to the need respectively before the segmentation is finished, that makes the new sort algorithm be the stable one. It is indicated that the stable and quick sort algorithm is stable in any case by the theoretical analysis and experimental data, and its performance is as good as the quick sort algorithm and the merge algorithm.
出处
《计算机应用与软件》
CSCD
北大核心
2014年第7期263-266,共4页
Computer Applications and Software
基金
江苏省"十二五"规划项目(D/2011/03/001
B-b/2011/03/003)
2011年常州工程职业技术学院基金项目(12JY010)
关键词
排序算法
算法稳定性
算法时间复杂度
算法空间复杂度
稳定快速排序
Sort algorithm
Algorithm stability
Algorithm time complexity
Algorithm space complexity
Stable and quick sort