:

for x:=2 to n do

x:=a[i]

a[1]...a[i]

end

,

a( j ), , a( j ) () "" . , :

1. a( j ) , , .

2. .

Procedure StraightInsertion

Var

i,j:index; x:item;

begin

for i:=2 to n do

x:=a[i]; a[0]:=x; j:=1;

while x<a[j-1] do a[j-1]:=a[j-1]; j:=j-1; end;

a[j]:=x

end

end StraightInsertion




- -  - -  - -