4 void AfficheTab(int T
[], int n
) {
5 for (int i
= 0; i
< n
; i
++) {
6 printf("T[%d]=%d\n", i
, T
[i
]);
10 void TriFusion(int T
[], int n
) {
11 int i
= 0, j
= 0, k
= 0;
17 T1
= malloc(milieu
*sizeof(int));
18 T2
= malloc(((n
- milieu
)*sizeof(int)));
19 for (int i
= 0; i
< milieu
; i
++) {
22 for (int i
= milieu
; i
< n
; i
++) {
23 T2
[i
- milieu
] = T
[i
];
25 TriFusion(T1
, milieu
);
26 TriFusion(T2
, n
- milieu
);
27 while (k
< milieu
&& j
< (n
- milieu
)) {
43 while (j
< n
- milieu
) {
54 //int T[] = {2, 7, 2, 3, 4, 1, 5, 5};
55 int T
[] = {6, 2, 3, 1, 9, 10, 15, 13, 12, 17};
56 int tabSize
= sizeof(T
)/sizeof(T
[0]);
58 AfficheTab(T
, tabSize
);
60 TriFusion(T
, tabSize
);
62 AfficheTab(T
, tabSize
);