summaryrefslogtreecommitdiff
path: root/sort/sort_test.go
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2020-08-06 11:06:05 +0100
committerPaul Buetow <git@mx.buetow.org>2020-08-06 11:06:05 +0100
commitddee1778446fbdf17587fed5ba2b6edc76c05b69 (patch)
tree6529df91a69b1273fced8fc0ebbeb023cf599153 /sort/sort_test.go
parente858efc16960b86175d655add938acd3f1edd13e (diff)
initial quick sort but have to figure out why it is so slow
Diffstat (limited to 'sort/sort_test.go')
-rw-r--r--sort/sort_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/sort/sort_test.go b/sort/sort_test.go
index ad75fff..bd9db9b 100644
--- a/sort/sort_test.go
+++ b/sort/sort_test.go
@@ -33,6 +33,12 @@ func TestShellSort(t *testing.T) {
}
}
+func TestQuickSort(t *testing.T) {
+ for i := 1; i <= maxLength; i *= 10 {
+ test(Quick, i, t)
+ }
+}
+
func TestShuffleSort(t *testing.T) {
for i := 10; i <= maxLength; i *= 10 {
testShuffle(Shuffle, i, t)
@@ -57,6 +63,12 @@ func BenchmarkShellSort(b *testing.B) {
}
}
+func BenchmarkQuickSort(b *testing.B) {
+ for i := 1; i <= maxLength; i *= 10 {
+ benchmark(Quick, i, b)
+ }
+}
+
func BenchmarkShuffleSort(b *testing.B) {
for i := 1; i <= maxLength; i *= 10 {
benchmark(Shuffle, i, b)