computer-science-golang

module
v0.0.0-...-91b1942 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2021 License: GPL-3.0

README

computer-science-golang

My personal repo with different computer-science implementation of algorithms and data structures

Comparing search algorithm

Search in array with 1.000.000 items

BenchmarkSimpleSearch O(log n)
BenchmarkSimpleSearch-4   	    2186	    524613 ns/op

BenchmarkBinarySearch O(n)
BenchmarkBinarySearch-4   	28309273	        40.6 ns/op

Comparing sort algorithms

BenchmarkQuickSort 1m items O(n * log n)
BenchmarkQuickSort-4   	     698	   1716028 ns/op

BenchmarkMergeSort 1m items O(n * log n)
BenchmarkMergeSort-4   	      12	  96197076 ns/op

BenchmarkSelectionSort 100k items O(n^2)
BenchmarkSelectionSort-4   	 1	8143228671 ns/op

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL