package
0.0.0-20240814153542-64ae15e81c8c
Repository: https://github.com/iamsumit/go-dsa.git
Documentation: pkg.go.dev
# README
Benchmark Result
BenchmarkLinearSearchFirstElement-10 0.9575 ns/op
BenchmarkLinearSearch100thElement-10 33.10 ns/op
BenchmarkLinearSearch500thElement-10 170.6 ns/op
BenchmarkLinearSearch1000thElement-10 325.2 ns/op
BenchmarkLinearSearch5000thElement-10 1578 ns/op
BenchmarkLinearSearch10000thElement-10 3211 ns/op
BenchmarkLinearSearch50000thElement-10 16049 ns/op
BenchmarkLinearSearchLastElement-10 33071 ns/op
BenchmarkLinearSearchElementNotPresent-10 31329 ns/op
BenchmarkLinearSearchRandomOrder-10 19874 ns/op
BenchmarkBinarySearch1000Elements-10 10.43 ns/op
BenchmarkBinarySearch10000Elements-10 17.46 ns/op
BenchmarkBinarySearch100000Elements-10 20.59 ns/op
BenchmarkBinarySearch100000000Elements-10 78.11 ns/op
BenchmarkBinarySearchRandomIncrement-10 101242900 ns/op
BenchmarkBinarySearchElementNotPresent-10 18.19 ns/op
BenchmarkTernarySearch1000Elements-10 11.91 ns/op
BenchmarkTernarySearch10000Elements-10 19.35 ns/op
BenchmarkTernarySearch100000Elements-10 25.05 ns/op
BenchmarkTernarySearch100000000Elements-10 84.39 ns/op
BenchmarkTernarySearchRandomIncrement-10 83655611 ns/op
BenchmarkTernarySearchElementNotPresent-10 24.90 ns/op
BenchmarkJumpSearchFirstElement-10 3.292 ns/op
BenchmarkJumpSearch100thElement-10 52.68 ns/op
BenchmarkJumpSearch500thElement-10 108.8 ns/op
BenchmarkJumpSearch1000thElement-10 33.41 ns/op
BenchmarkJumpSearch5000thElement-10 154.5 ns/op
BenchmarkJumpSearch10000thElement-10 143.5 ns/op
BenchmarkJumpSearch50000thElement-10 175.0 ns/op
BenchmarkJumpSearchLastElement-10 347.4 ns/op
BenchmarkJumpSearchElementNotPresent-10 359.6 ns/op
BenchmarkJumpSearchElementNotPresentNegative-10 167.7 ns/op
BenchmarkInterpolationSearch1000Elements-10 0.9440 ns/op
BenchmarkInterpolationSearch10000Elements-10 0.9393 ns/op
BenchmarkInterpolationSearch100000Elements-10 0.9419 ns/op
BenchmarkInterpolationSearch100000000Elements-10 1.180 ns/op
BenchmarkInterpolationSearchMidElement1-10 1.544 ns/op
BenchmarkInterpolationSearchMidElement2-10 1.517 ns/op
BenchmarkInterpolationSearchRandomIncrement 1211438625 ns/op
BenchmarkInterpolationSearchElementNotPresent-10 0.9941 ns/op
BenchmarkExponentialSearch1000Elements-10 16.20 ns/op
BenchmarkExponentialSearch10000Elements-10 24.64 ns/op
BenchmarkExponentialSearch100000Elements-10 32.17 ns/op
BenchmarkExponentialSearch100000000Elements-10 72.92 ns/op
BenchmarkExponentialSearchRandomIncrement-10 253229281 ns/op
BenchmarkExponentialSearchElementNotPresent-10 32.21 ns/op
BenchmarkExponentialSearchElementNotPresentNegative-10 28.94 ns/o