procedure sort( var r : ArrayToSort; lo, up : integer );
var i, j : integer;
tempr : ArrayEntry;
flag : boolean;
begin
for i:=up-1 downto lo do begin
tempr := r[i];
j := i+1;
flag := true;
while (j<=up) and flag do
if tempr.k > r[j].k then begin
r[j-1] := r[j];
j := j+1
end
else flag := false;
r[j-1] := tempr
end
end;
|