文件名称:algorithm.zip
文件大小:14KB
文件格式:ZIP
更新时间:2023-03-26 07:15:28
冒泡排序 快速排序 归并排序 c语言 排序算法
运行 (参数为排序的随机数个数) cpu : i7 6700 ./build/test_tools/sort_test -n 100000000 -d 7 quick_sort 17s: 17110ms: 17110444us merge_sort 19s: 19820ms: 19820072us radix_sort 28s: 28092ms: 28092259us heap_sort 56s: 56574ms: 56574802us shell_sort 71s: 71964ms: 71964163us radix_linklist_sort2 139s: 139973ms: 139973427us ./build/test_tools/sort_test -n 10000000 -d 7 quick_sort 1s: 1543ms: 1543532us merge_sort 1s: 1778ms: 1778195us radix_sort 2s: 2801ms: 2801270us heap_sort 4s: 4003ms: 4003165us shell_sort 5s: 5042ms: 5042797us radix_linklist_sort2 11s: 11532ms: 11532565us ./build/test_tools/sort_test -n 10000000 -d 3 radix_sort 1s: 1268ms: 1268978us merge_sort 1s: 1320ms: 1320427us heap_sort 2s: 2968ms: 2968279us shell_sort 2s: 2983ms: 2983569us radix_linklist_sort2 3s: 3921ms: 3921389us quick_sort 79s: 79280ms: 79280755us (数值缩小后快排变慢) ./build/test_tools/sort_test -n 1000000 -d 7 quick_sort 0s: 133ms: 133657us merge_sort 0s: 153ms: 153216us heap_sort 0s: 263ms: 263430us radix_sort 0s: 285ms: 285582us shell_sort 0s: 346ms: 346770us radix_linklist_sort2 0s: 994ms: 994642us ./build/test_tools/sort_test -n 1000000 -d 3 merge_sort 0s: 123ms: 123642us radix_sort 0s: 127ms: 127985us heap_sort 0s: 230ms: 230044us shell_sort 0s: 268ms: 268450us radix_linklist_sort2 0s: 369ms: 369870us quick_sort 0s: 876ms: 876044us (数值缩小后快排变慢) ./build/test_tools/sort_test -n 100000 -d 7 quick_sort 0s: 10ms: 10627us merge_sort 0s: 12ms: 12734us heap_sort 0s: 20ms: 20134us shell_sort 0s: 25ms: 25675us radix_sort 0s: 28ms: 28221us radix_linklist_sort2 0s: 32ms: 32812us ./build/test_tools/sort_test -n 100000 -d 3 merge_sort 0s: 11ms: 11431us radix_sort 0s: 11ms: 11894us quick_sort 0s: 15ms: 15269us radix_linklist_sort2 0s: 16ms: 16105us heap_sort 0s: 20ms: 20658us shell_sort 0s: 21ms: 21209us
【文件预览】:
algorithm
----shell_sort()
--------shell_sort_bk.c(1KB)
--------shell_sort.c(587B)
--------CMakeLists.txt(83B)
----readme.md(4KB)
----merge_sort()
--------merge_sort.c(1KB)
--------CMakeLists.txt(45B)
----heap_sort()
--------CMakeLists.txt(43B)
--------heap_sort.c(743B)
----bubble_sort()
--------bubble_sort.c(508B)
--------CMakeLists.txt(50B)
----selection_sort()
--------selection_sort.c(377B)
--------CMakeLists.txt(53B)
----quick_sort()
--------quick_sort.c(525B)
--------CMakeLists.txt(47B)
----radix_sort()
--------radix_sort.c(1KB)
--------radix_linklist_sort.c(2KB)
--------CMakeLists.txt(71B)
----.gitignore(18B)
----CMakeLists.txt(345B)
----interpolation_sort()
--------interpolation_sort.c(368B)
--------CMakeLists.txt(63B)
----test_tools()
--------sort_test.c(7KB)
--------CMakeLists.txt(196B)
----make.sh(51B)
----clean.sh(27B)
----other_api()
--------list.h(909B)