summaryrefslogtreecommitdiff
path: root/sort/selection.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-08-08 13:01:36 +0100
committerPaul Buetow <pbuetow@mimecast.com>2020-08-08 13:01:36 +0100
commit390333bb314f6cb25adc5716ea383112860ed342 (patch)
tree2b87d5741d84b2cd2d7c74eaaa0f522c3a8a221c /sort/selection.go
parentdeaa4e1c33cd2c1c75f698881918688055abfa51 (diff)
add parallelquick and so on
Diffstat (limited to 'sort/selection.go')
-rw-r--r--sort/selection.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/sort/selection.go b/sort/selection.go
index 3a5774f..66d221e 100644
--- a/sort/selection.go
+++ b/sort/selection.go
@@ -6,6 +6,7 @@ import (
func Selection(a ds.ArrayList) ds.ArrayList {
length := len(a)
+
for i := 0; i < length; i++ {
min := i
for j := i + 1; j < length; j++ {
@@ -20,5 +21,6 @@ func Selection(a ds.ArrayList) ds.ArrayList {
a[i] = a[min]
a[min] = tmp
}
+
return a
}