« Implémentation d'algorithmes classiques/Algorithmes de tri/Tri de Shell » : différence entre les versions
Contenu supprimé Contenu ajouté
m <source> -> <syntaxhighlight> (phab:T237267) |
|||
Ligne 1 :
== GFA [[Programmation Basic|BASIC]] ==
<
PROCEDURE Tri_Shell(N As Int, ByRef E() As Int)
Local Int D, LIMITE, INTERVERSION, J, I
Ligne 21 :
Loop While D > 0 ' sauf si plus possible de diminuer la distance
Return
</syntaxhighlight>
== [[Programmation C|C]] ==
<
/*
* Exécute un tri par insertion avec la séparation donnée
Ligne 60 :
shellSortPhase(a, length, gaps[sizeIndex]);
}
</syntaxhighlight>
== [[Programmation C++|C++]] ==
<
/* Réadaptation du code précédent en C++, avec template pour pouvoir s'adapter
Ligne 93 :
}
</syntaxhighlight>
== [[Programmation C sharp|C#]] ==
<
using System;
public class ShellSorter
Ligne 133 :
}
}
</syntaxhighlight>
== [[Programmation Java|Java]] ==
<
public static void triDeShell(int [] tab,int tailleLogique){
int pas = 1;
Ligne 161 :
}
}
</syntaxhighlight>
== [[Programmation Pascal|Pascal]] ==
Implémention du tri Shell en Pascal (par ordre croissant).
<
type
arrayOfInteger = array of integer;
Ligne 201 :
end;
end;
</syntaxhighlight>
== Python ==
Implémentation du tri Shell en Python (par ordre croissant).
<
def triInsertion(tab, i0=0, dec=1):
"""
Ligne 240 :
for i in range(0, dec):
triInsertion(tab, i, dec)
</syntaxhighlight>
<small>Tout ou partie de cette page est issue de l'article Wikipédia « [[w:Tri_de_Shell|Tri de Shell]] » dans sa [{{fullurl:w:Tri_de_Shell|oldid=54854817}} version du 2 juillet 2010].</small>
|