Skip to content
Snippets Groups Projects

makefile et autres

Open LEPPERT MICHAEL requested to merge mleppert/P4z:master into master
Viewing commit 99f7b04a
Show latest version
3 files
+ 42
6
Preferences
Compare changes
Files
3
+ 19
2
@@ -61,12 +61,29 @@ void genTabDecroi(long tabARemplir[], size_t tailleTab, int maxVal) {
for(size_t i=0; i<tailleTab; i++){
tabARemplir[i]=rand()%(maxVal);
}
qsort( tabARemplir, tailleTab, sizeof(long), longComparator );
qsort( tabARemplir, tailleTab, sizeof(long), longComparatorDecroi );
}
int longComparator ( const void * first, const void * second ) {
int longComparatorDecroi ( const void * first, const void * second ) {
return ( *(long*)second - *(long*)first );
}
void genTabCroi(long tabARemplir[], size_t tailleTab, int maxVal) {
int rand_is_seeded = 0;
if(!rand_is_seeded)
{
srand(time(NULL));
rand_is_seeded = 1;
}
for(size_t i=0; i<tailleTab; i++){
tabARemplir[i]=rand()%(maxVal);
}
qsort( tabARemplir, tailleTab, sizeof(long), longComparatorCroi );
}
int longComparatorCroi ( const void * first, const void * second ) {
return ( *(long*)first - *(long*)second );
}
void affiche_infos(struct compteur cpt){
printf("nombre de comparaisons : %ld\n", cpt.comparaison);
printf("nombre d'écritures : %ld\n", cpt.ecriture);