Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <stdio.h>
#include <stdlib.h>
#include "tris.h"
#include "utils.h"
int main(int argc, char *argv[]) {
if(argc != 4) {
printf("Usage: %s [typeAlgo] [taille] [isAfficher]\n", argv[0]);
exit(1);
}
char typeAlgo = argv[1][0];
long taille = (long) atoi(argv[2]);
long MAX = 50;
long tab[taille];
size_t afficher = (size_t) atoi(argv[3]);
genTab(tab, taille, MAX);
switch(typeAlgo) {
case 'i':
printf("Tri Insertion: \n");
triInsertion(tab,taille);
if(afficher)
affichertab(tab,taille);
break;
case 'r':
printf("Tri Rapide: \n");
triRapide(tab, taille);
if(afficher)
affichertab(tab,taille);
break;
case 'f':
printf("Tri Fusion: \n");
triFusion(tab, taille);
if(afficher)
affichertab(tab,taille);
break;
}
return 0;
}