期刊文献+

一个拟就地稳定归并排序算法

A Stable In-situ Merge Sort Algorithm
下载PDF
导出
摘要 为了降低经典归并排序算法O(n)的附加空间并保持稳定性,提出一个新的拟就地归并算法.介绍了根据移动次数导出的段长关系进行选择的原理,给出了相应的归并及归并排序的C语言算法,用大量随机序列进行了排序对比测试;测试组数自动选取,拟合结果为比较次数约为20.13nln(n)+1.24nln(n)-1.22n,移动次数约为20.655nln(n)-0.89nln(n)+2.6n、附加栈空间O(ln(n)).得益于算法的简便性,附加程序开销小,在测试范围内实际时空耗费在同类算法中有明显优势. In order to reduce the O (n) additional space of classical merge sort and keep stability, a new in-situ merging algorithm is presented. The length principle derived from the mobile number of assignments is introduced. Corresponding merge sort in C language was tested by groups of random sequences, the number of groups is also chosen automatically. Results show that the number of comparisons is about20.13nln(n)+1.24nln(n)?1.22n, the number of assignments is about20.655nln(n)?0.89nln(n)+2.6n, the additional stack space isO(ln(n))benefiting by simplicity and low additional program cost, the algorithm presented exhibits a clear advantage in both practical time and space consuming compared with an efficient merge sort algorithm.
作者 胡圣荣
出处 《湖南理工学院学报(自然科学版)》 CAS 2014年第2期45-49,共5页 Journal of Hunan Institute of Science and Technology(Natural Sciences)
关键词 归并 就地归并 归并排序 算法 merge in-place merge merge sort algorithm
  • 相关文献

参考文献9

  • 1Munro J I,Raman V. Selection from Read-only Memory and Sorting with Minimum Data Movement[J].Theoretical computer science,1996,(02):311-323.
  • 2Geffert V,Katajainen J,Pasanen T. Asymptotically Eficient in-place Merging[J].Theoretical computer science,2000,(01):159-181.
  • 3Kronrod M A. Optimal Ordering Algorithm without Operational Field[J].Soviet Math Dokl,1969,(744-746):342.
  • 4Reinhardt K. Sorting in-place With a Worst Case Complexity of nlogn-1.3n+O(logn)Comparisons andεnlogn+O(1)Transports[A].Springer Berlin Heidelberg,1992.489-498.
  • 5Ellis J,Markov M. In situ,Stable Merging by Way of the Perfect Shufle[J].The Computer Journal,2000,(01):40-53.
  • 6Kim P S,Kutzner A. On Optimal and Eficient in Place Merging[A].Springer Berlin Heidelberg,2006.350-359.
  • 7白宇,郭显娥.深度优先稳定原地归并排序的高效算法[J].计算机应用,2013,33(4):1039-1042. 被引量:7
  • 8胡圣荣.关于排序算法的随机输入序列[J].武汉理工大学学报,2006,28(9):105-107. 被引量:6
  • 9胡圣荣.关于排序效率的数值估计[J].广州城市职业学院学报,2008,2(1):61-64. 被引量:4

二级参考文献16

  • 1胡圣荣.关于排序算法的随机输入序列[J].武汉理工大学学报,2006,28(9):105-107. 被引量:6
  • 2Knuth D E.计算机程序设计艺术(第3卷排序与查找)[M].第2版.苏运霖,译.北京:国防工业出版社,2002.
  • 3Sanders P, Fleischer R. Asymptotic Complexity from Experiments? A Case Study for Randomized Algorithms[J]. Lecture Notes in Computer Science, 2001,1982 : 135-146.
  • 4Weiss M A. Empirical Study of the Expected Running Time of Shellsort[J]. The Computer Journal, 1991,34 (1) :88-91.
  • 5Mark Allen Weiss.数据结构与问题求解(Java版)[M].第2版.陈明,译.北京:电子工业出版社,2003.
  • 6Bentley J. Programming Pearls[J]. Communications of the ACM, 1987,30 (9) : 754-757.
  • 7BERGIN J. Data structure programming[ M]. New York: Springer- Verlag, 2005: 270 - 301.
  • 8MAIN M. Data structure and other objects using C ++ [ M ]. Bos- ton : Addison-Wesley,2004 : 104 - 115.
  • 9KLEINBERG J, TARDOS E. Algorithm design[M]. Boston:Addi- son-Wesley,2005 : 157 - 179.
  • 10CORMEN, T H , LEISERSON C E , RIVEST R L , et al . Introduction to algorithms[ M]. Boston: MIT Press, 2005:115 - 146.

共引文献11

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部