随笔-11  评论-20  文章-0  trackbacks-0
     测试程序在我上一篇文章里有,大家可以参考。

排序10000数字的测试结果:
Bubble Sort Ascend: 0
Bubble Sort Descend: 0.12
Bubble Sort Normal: 0.328
Exchange Sort Ascend: 0.0
Exchange Sort Descend: 0.
Exchange Sort Normal: 0.3
Selection Sort Ascend: 0.
Selection Sort Descend: 0
Selection Sort Normal: 0.
Insertion Sort Ascend: 0
Insertion Sort Descend: 0
Insertion Sort Normal: 0.
Shell Sort Ascend: 0
Shell Sort Descend: 0
Shell Sort Normal: 0
MergeSort Ascend: 0
Merge Sort Descend: 0
Merge Sort Normal: 0
Heap Sort Ascend: 0
Heap Sort Descend: 0
Heap Sort Normal: 0
Quick Sort Ascend: 0
Quick Sort Descend: 0
Quick Sort Normal: 0

排序100000数字的测试结果:

Bubble Sort Ascend: 0
Bubble Sort Descend: 16.953
Bubble Sort Normal: 33.5
Exchange Sort Ascend: 7.203
Exchange Sort Descend: 11.54
Exchange Sort Normal: 33.312
Selection Sort Ascend: 7.391
Selection Sort Descend: 9.57
Selection Sort Normal: 8.328
Insertion Sort Ascend: 0
Insertion Sort Descend: 7.29
Insertion Sort Normal: 6.296
Shell Sort Ascend: 0
Shell Sort Descend: 0.016
Shell Sort Normal: 0.016
MergeSort Ascend: 0
Merge Sort Descend: 0.016
Merge Sort Normal: 0.031
Heap Sort Ascend: 0.016
Heap Sort Descend: 0.015
Heap Sort Normal: 0.032
Quick Sort Ascend: 0
Quick Sort Descend: 0
Quick Sort Normal: 0.015

排序200000数字的测试结果:
Bubble Sort Ascend: 0
Bubble Sort Descend: 69.797
Bubble Sort Normal: 134.875
Exchange Sort Ascend: 31.172
Exchange Sort Descend: 55.891
Exchange Sort Normal: 133.515
Selection Sort Ascend: 31.938
Selection Sort Descend: 40
Selection Sort Normal: 33.375
Insertion Sort Ascend: 0
Insertion Sort Descend: 45.96
Insertion Sort Normal: 28.875
Shell Sort Ascend: 0.016
Shell Sort Descend: 0.015
Shell Sort Normal: 0.047
MergeSort Ascend: 0.015
Merge Sort Descend: 0.032
Merge Sort Normal: 0.047
Heap Sort Ascend: 0.031
Heap Sort Descend: 0.031
Heap Sort Normal: 0.094
Quick Sort Ascend: 0
Quick Sort Descend: 0
Quick Sort Normal: 0.032

排序1000000数字的测试结果(不包括O(N*N)的排序算法):
Shell Sort Ascend: 0.063
Shell Sort Descend: 0.094
Shell Sort Normal: 0.343
MergeSort Ascend: 0.157
Merge Sort Descend: 0.14
Merge Sort Normal: 0.281
Heap Sort Ascend: 0.14
Heap Sort Descend: 0.156
Heap Sort Normal: 0.516
Quick Sort Ascend: 0.015
Quick Sort Descend: 0.047
Quick Sort Normal: 0.156

排序10000000数字的测试结果(不包括O(N*N)的排序算法):
Shell Sort Ascend: 2.344
Shell Sort Descend: 4.718
Shell Sort Normal: 5.406
MergeSort Ascend: 2.391
Merge Sort Descend: 1.812
Merge Sort Normal: 10.5
Heap Sort Ascend: 1.828
Heap Sort Descend: 1.906
Heap Sort Normal: 12.219
Quick Sort Ascend: 0.282
Quick Sort Descend: 0.578
Quick Sort Normal: 8.704
posted on 2009-09-01 20:06 diwayou 阅读(2135) 评论(2)  编辑 收藏 引用 所属分类: 数据结构与算法

评论:
# re: 各种排序算法性能测试结果 2009-09-01 22:29 | CY
听说插入排序在“基本有序”时是很快的,却不知道“基本有序”的程度要达到什么样才能跟那些nlogn的排序那么快  回复  更多评论
  
# re: 各种排序算法性能测试结果 2009-09-02 07:57 | 凡客
不知道“基本有序”的程度要达到什么样才能跟那些nlogn的排序那么快  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理