#include #include #include #include #include #include "sort.h" #define MAX 100 // Optional printing of tab void print_optional(s_data_t tab[], int tab_size, int print){ if(print){ print_tab(tab,tab_size); } } // Check if elements of tab are in increasing order void check_sorted(s_data_t tab[], int size) { int i; char sorted = 1; for(i=0; i tab[i+1]){ sorted = 0; } } if(sorted == 1){ printf("Contents of tab is ordered\n"); }else{ printf("Contents of tab is NOT ordered : %d %d -> %d %d\n", i-1, i, tab[i-1], tab[i]); } } // Main program int main() { int size=1000; int print=0; struct timeval start, stop; // Dynamic allocation of tabs s_data_t *tab=(int*)malloc(size*sizeof(s_data_t)); s_data_t *tab_copy=(int*)malloc(size*sizeof(s_data_t)); // Random initialization of tab srand(time(NULL)); for(int i=0; i