Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
const proc: shellSort (inout array elemType: arr) is func
|
||||
local
|
||||
var integer: i is 0;
|
||||
var integer: j is 0;
|
||||
var integer: increment is 0;
|
||||
var elemType: help is elemType.value;
|
||||
begin
|
||||
increment := length(arr) div 2;
|
||||
while increment > 0 do
|
||||
for i range 1 to length(arr) do
|
||||
j := i;
|
||||
help := arr[i];
|
||||
while j > increment and arr[j - increment] > help do
|
||||
arr[j] := arr[j - increment];
|
||||
j -:= increment;
|
||||
end while;
|
||||
arr[j] := help;
|
||||
end for;
|
||||
increment := increment div 2;
|
||||
end while;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue