j'ai un petit prob c'est que j'arrive pas à transformer correctement
cet algorithme en langage java:
Algorithm 1 WienerIndicesOfBinaryTrees
Require: An integer N, the maximum value of n.
Ensure: The lists L(n) where 1<=n<=N.
An integer M, the maximum value of W(Fd(n)) over all 1<=n<=N.
The boolean list W[0...M] whose i-th value is 1 if i is in the lists L(n)1<=n<=N; 0 otherwise.
L(0) = {0, 0} and L(1) = {0, 0} {Initialization}
2: for i = 1 to sizeofW[] do
3: W[i] = 0
4: end for
5: for n = 2 to N do
6: L(n) =0;
7: for n1 = 0 to(b(n − 1)/2) do
8: n2 = n − n1 − 1
9: for each (l1,w1) appartient à L(n1) and each (l2,w2) 2 L(n2) do
10: l = l1 + l2 + n − 1
11: w = w1 + l1 + n1 + w2 + l2 + n2 + l1n2 + l2n1 + 2n1n2
12: if (l,w) /2 L(n) then
13: insert (l,w) in L(n)
14: W[w] = 1
15: M = M + 1
16: end if
17: end for
18: end for
19: end for
si vous avez des solutions merci de me l'envoyer et de m'aider j'ai vraiment besoin de votre aide
merciiiiii
× Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
× Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.