Like Heapsort —which inspired it— smoothsort is an algorithm for sorting in situ. It is of order N∙log N in the worst case, but of order N in the best case, with a smooth transition between the two.
An implementation of Dijkstra's Smoothsort algorithm, a modification of heapsort that runs in O(n lg n) in the worst case, but O(n) if the data are already sorted ...
with { 1, 2 } instead of { 1, 1 }. They coincide with the nonzero Fibonacci-minus-1 numbers, hence the name "smoothsort_fib_1()". The code gets simpler at some points but longer at others. Now there ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する