summaryrefslogtreecommitdiff
path: root/sort/shell.go
diff options
context:
space:
mode:
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