cs_Charlie
Messages postés110Date d'inscriptionjeudi 9 mai 2002StatutMembreDernière intervention11 mars 2010
-
22 juil. 2002 à 00:44
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 2013
-
22 juil. 2002 à 17:51
Allo...
Y'a-t-il moyen en VB de développer la récursivité autant qu'en C... J'ai tansposé un algo de trie récursif mais Vb ne l'aime pas trop!!! C'est domage car c'est full performant comme algo.
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 201311 22 juil. 2002 à 17:51
' Algorithme de tri "shell" sur un tableau Total(Maximum)
Dim i As Integer, j As Integer, k As Integer, l As Integer, Provi As même chose que Total
k = 1
While k <= Maximum
k = k * 2
Wend
Do
k = (k - 1) \ 2
If k = 0 Then Exit Do ' tri terminé
For l = 1 To Maximum - k
i = l
Do
j = i + k
If Total(i) > Total(j) Then Exit Do Provi Total(i): Total(i) Total(j): Total(j) = Provi
i = i - k
Loop While i > 0
Next l
Loop