forall i /* cellule */ if ((i.suivant == nil) || (i.suivant.couleur == bleu)) { i.fini = true; i.bleu = i.suivant; } while exist i such that (i.fini == false) forall i if (i.fini == false) { i.fini = i.suivant.fini; if (i.fini == true) i.bleu = i.suivant.bleu; i.suivant = i.suivant.suivant; }
|
¬ |
|
Givens(A) 1: for (k=1;k<n;k++) 2: for (i=n;i>k;i--) 3: Rot(i-1,i,k);On considère qu'une rotation Rot(i,j,k) s'exécute en temps unité, indépendamment de k.
Temps | P1 | P2 | P3 | P4 | P5 | P6 | P7 | P8 | ||||||||
1 |
|
|||||||||||||||
2 | Rot(7,8,1) | |||||||||||||||
3 | Rot(6,7,1) |
|
||||||||||||||
4 | Rot(5,6,1) | Rot(7,8,2) | ||||||||||||||
5 | Rot(4,5,1) | Rot(6,7,2) |
|
|||||||||||||
6 | Rot(3,4,1) | Rot(5,6,2) | Rot(7,8,3) | |||||||||||||
7 | Rot(2,3,1) | Rot(4,5,2) | Rot(6,7,3) |
|
||||||||||||
8 | Rot(1,2,1) | Rot(3,4,2) | Rot(5,6,3) | Rot(7,8,4) | ||||||||||||
9 |
|
Rot(2,3,2) | Rot(4,5,3) | Rot(6,7,4) |
|
|||||||||||
10 |
|
|
Rot(3,4,3) | Rot(5,6,4) | Rot(7,8,5) | |||||||||||
11 |
|
|
|
Rot(4,5,4) | Rot(6,7,5) |
|
||||||||||
12 |
|
|
|
|
Rot(5,6,5) | Rot(7,8,6) | ||||||||||
13 |
|
|
|
|
|
Rot(6,7,6) |
|
|||||||||
14 |
|
|
|
|
|
|
Rot(7,8,7) | |||||||||
15 |
|
|
|
|
|
|
|
|
Temps | P1 | P2 | P3 | P4 | |
1 |
|
||||
2 | Rot(7,8,1) | ||||
3 | Rot(6,7,1) |
|
|||
4 | Rot(5,6,1) | Rot(7,8,2) | |||
5 | Rot(4,5,1) | Rot(6,7,2) |
|
||
6 | Rot(3,4,1) | Rot(5,6,2) | Rot(7,8,3) | ||
7 | Rot(2,3,1) | Rot(4,5,2) | Rot(6,7,3) |
|
|
8 | Rot(1,2,1) | Rot(3,4,2) | Rot(5,6,3) | Rot(7,8,4) | |
9 | Rot(2,3,2) | Rot(4,5,3) | Rot(6,7,4) |
|
|
10 | Rot(3,4,3) | Rot(5,6,4) | Rot(7,8,5) | ||
11 | Rot(4,5,4) | Rot(6,7,5) |
|
||
12 | Rot(5,6,5) | Rot(7,8,6) | |||
13 | Rot(6,7,6) |
|
|||
14 | Rot(7,8,7) | ||||
15 |
|
This document was translated from LATEX by HEVEA.