RE:algoritmo de ordenacio shell
Algoritmo Ordenacion Shell (en turbo pascal).
procedure Shell (var elemento:array_de_datos; contador:integer);
const
t=5; {Cantidad de divisiones del Array}
var
i,j,k,s,m:integer;
h:array[1..t] of integer; {cada una de las celdas}
x:telemento_datos;
begin
h[1]:=9; {Arbitrario}
h[2]:=5;
h[3]:=3;
h[4]:=3;
h[5]:=1;
for m:=1 to t do
begin
k:=h[m]
s:=-k;
for i:=k+1 to contador do
begin
x:=elemento[i];
j:=i-k;
if s = 0 then
begin
s:=-k:
s:=s + 1;
elemento[s]:=x;
end;{if s}
while (x<elemento[j]) and (j>0) and (j<=contador) do
begin
elemento[j+k]:=elemento[j];
j:=j-k;
end;{while}
elemento[j+k]:=x;
end; {for i}
end;{For m}
end; {Shell}