Smoothsort, an Alternative for Sorting In Situ
暂无分享,去创建一个
Heapsort [0] [1] is an efficient algorithm for sorting m(i: 0 ≤ i < N) in situ; some, however, consider it a disadvantage of heapsort that it absolutely fails to exploit the circumstances in which the sequence is initially nearly sorted. While sharing in general with heapsort its N.log N characteristic, smoothsort does not share this disadvantage: for an initially (nearly) sorted sequence, smoothsort is of order N with a smooth transition between the two. Smoothsort can be viewed as a pure exchange sort that is of order N.log N in the worst case. For brevity’s sake we shall describe sorting the integer sequence m(i: 0 ≤ i < N) in ascending order.
[1] R. G. Stone,et al. Program Construction , 1979, Lecture Notes in Computer Science.
[2] Curtis R. Cook,et al. Best sorting algorithm for nearly sorted lists , 1980, CACM.