Bookmark and Share

Liens sponsorisés

Le Tri Shell Print E-mail
Written by Administrator   
Wednesday, 20 January 2010 10:35

Code source du Tri Shell

 

Procedure Tri_Shell_Rec (Var t: TAB; n,h : integer);
Var aux,i : integer;
begin
If h > 0 Then
Begin
If n > h Then
begin
Tri_Shell_Rec (t,n - h,h);
If t[n] < t[n - h] Then
Begin
aux:= t[n];
i := n;
Repeat
t[i] := t[i - h];
i := i - h;
Until (i = h) Or (aux > t[i - h]);
t[i] := aux;
End;
End;
Tri_Shell_Rec (t,n,h Div 3);
End;
End
;

Last Updated ( Wednesday, 20 January 2010 10:36 )
 

 

Liens sponsorisés