测试程序在我上一篇文章里有,大家可以参考。
排序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 阅读(2144)
评论(2) 编辑 收藏 引用 所属分类:
数据结构与算法