Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
procedure gnomesort(var arr : Array of Integer; size : Integer);
|
||||
var
|
||||
i, j, t : Integer;
|
||||
begin
|
||||
i := 1;
|
||||
j := 2;
|
||||
while i < size do begin
|
||||
if arr[i-1] <= arr[i] then
|
||||
begin
|
||||
i := j;
|
||||
j := j + 1
|
||||
end
|
||||
else begin
|
||||
t := arr[i-1];
|
||||
arr[i-1] := arr[i];
|
||||
arr[i] := t;
|
||||
i := i - 1;
|
||||
if i = 0 then begin
|
||||
i := j;
|
||||
j := j + 1
|
||||
end
|
||||
end
|
||||
end;
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue