/* C, library qsort */ #include #include #include typedef TYPE T; int compare_T(const void* a, const void* b) { T ai = *((T*)a), bi = *((T*)b); if(aibi) return 1; else return 0; } void test(int N) { T* data; time_t begin, end; double time_elapsed; int i; if(N < 1) { printf("Input value %d too small.\n", N); return; } data = (T*) malloc(N*sizeof(T)); if(!data) { printf("Could not allocate data - %d bytes.\n", N*sizeof(T)); return; } for(i=0; i\n", argv[0]); else { for(i=0; i<10; ++i) test(atoi(argv[1])); } return 0; }