Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
go =>
|
||||
A = [23, 76, 99, 58, 97, 57, 35, 89, 51, 38, 95, 92, 24, 46, 31, 24, 14, 12, 57, 78],
|
||||
println(A),
|
||||
shell_sort(A),
|
||||
println(A),
|
||||
nl.
|
||||
|
||||
% Inline sort
|
||||
shell_sort(A) =>
|
||||
Inc = round(A.length/2),
|
||||
while (Inc > 0)
|
||||
foreach(I in Inc+1..A.length)
|
||||
Temp = A[I],
|
||||
J := I,
|
||||
while (J > Inc, A[J-Inc] > Temp)
|
||||
A[J] := A[J-Inc],
|
||||
J := J - Inc
|
||||
end,
|
||||
A[J] := Temp
|
||||
end,
|
||||
Inc := round(Inc/2.2)
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue