cours_progra/bac2/os/chap3/group01-chap3/group.c
2023-12-21 23:36:03 +01:00

25 lines
514 B
C

#include "mergeSort.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define printlist(s, x) printf("%s = [", #x); for (int i = 0; i < s; ++i) { printf("%d, ", x[i]); } printf("\b\b]\n");
#define listSize 1000000
int list[listSize];
int main(void)
{
// liste de nombre aléatoires
srand(time(NULL));
for (int i = 0; i < listSize; ++i) {
list[i] = rand()%listSize;
}
/* printlist(listSize, list); */
mrg_t args = merge_init(list, listSize);
merge_sort(&args);
printlist(listSize, list);
}