summaryrefslogtreecommitdiff
path: root/sort/shell.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-08-08 16:00:07 +0100
committerPaul Buetow <pbuetow@mimecast.com>2020-08-08 16:00:07 +0100
commit719321d413bcc61e56786399799a9c80e94ab5d8 (patch)
treed97d67fd8b1b42f625c91a9f0c8d6b29819824e0 /sort/shell.go
parentb8c45f87d6f7251701f95eb6b8ac1efd4255d298 (diff)
fortune not found
Quick commit
Diffstat (limited to 'sort/shell.go')
-rw-r--r--sort/shell.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/sort/shell.go b/sort/shell.go
index 4a8fded..5fab584 100644
--- a/sort/shell.go
+++ b/sort/shell.go
@@ -5,17 +5,17 @@ import (
)
func Shell(a ds.ArrayList) ds.ArrayList {
- length := len(a)
+ l := len(a)
// h-sort the array
h := 1
- for h < length/3 {
+ for h < l/3 {
// 1, 4, 13, 40, 121, 364, 1093...
h = 3*h + 1
}
for h >= 1 {
- for i := h; i < length; i++ {
+ for i := h; i < l; i++ {
for j := i; j >= h; j -= h {
if a[j-h] < a[j] {
break