2011-08-02 3 views
-1

可能性の重複:?
What sort algorithm provides the best worst-case performance?ソートにはどのメソッドが最適ですか?

整数配列をソートするために使用することができます最善の方法であるクイックソート効率的ですか? ソートに使用される一般的な方法のいくつかは、彼らは異なるソート方法が異なる機能を持つ可能ですされている[削除スパムのリンク]

+0

重複:http://stackoverflow.com/questions/220044/which-sort-algorithm-works-best-on-mostly-sorted-data http://stackoverflow.com/questions/773253/what -sort-algorithm - 最悪の場合のパフォーマンスを提供する – gideon

答えて

1

に記載されています。

Bubble Sort [It's simple but not good for large data][1] 

Selection Sort [Selection sort is noted for its simplicity, and also has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.][2] 

Insertion Sort [It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.][3] 

Quick Sort [Quicksort is often faster in practice than other O(nlogn) algorithms][4] 

Merge Sort [Merge sort is an O(n log n) comparison-based sorting algorithm][5] 

Heap Sort [it has the advantage of a more favorable worst-case O(n log n) runtime. Heapsort is an in-place algorithm, but is not a stable sort.][6] 
関連する問題