4 void permuter(int T
[], int i1
, int i2
) {
10 void AfficheTab(int T
[], int n
) {
11 for (int i
= 0; i
< n
; i
++) {
12 printf("T[%d]=%d\n", i
, T
[i
]);
16 void TriRapide(int T
[], int n
) {
17 // The optimal pivot choice is the median value in the tab
18 int index_pivot
= arc4random_uniform(n
);
19 int pivot
= T
[index_pivot
];
27 if (T
[0] > T
[1]) { permuter(T
, 0, 1); }
30 for (int i
= 1; i
< n
; i
++) {
41 for (int i
= 0; i
< np
; i
++) {
45 for (int i
= 0; i
< ng
; i
++) {
46 T
[np
+ 1 + i
] = TG
[i
];
52 int T
[7] = {4, 2, 7, 3, 8, 6, 5};