Skip to content

cjxhaaa/algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

排序算法比较

100W数据

heapsort

goos: darwin
goarch: amd64
pkg: algorithm/sortMethod/heapsort
BenchmarkHeapsort-4   	      10	 110767091 ns/op
PASS

shellsort

goos: darwin
goarch: amd64
pkg: algorithm/sortMethod/shellsort
BenchmarkInsertSort-4   	      20	  54952254 ns/op
PASS

mergesort

goos: darwin
goarch: amd64
pkg: algorithm/sortMethod/mergesort
BenchmarkMergeSort-4   	      10	 152582040 ns/op
PASS

quicksort

goos: darwin
goarch: amd64
pkg: algorithm/sortMethod/quicksort
BenchmarkQuickSort-4   	      20	  56103500 ns/op
PASS

insertsort

跑了半天没跑出来,看来O(n²)的算法在排序大数据时性能确实不行

About

常见算法golang实现

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages