Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "windows.h"
- #include "stdlib.h"
- #include "time.h"
- #define BUFFER_SIZE 1000000
- #define FIRST_ELEM 0
- int main(){
- unsigned int start_time;
- unsigned int end_time;
- int arr_length = 0;
- int i = 0;
- int * arr;
- arr = malloc(BUFFER_SIZE*sizeof(int));
- if (!arr){
- return 1;
- }
- srand(time(NULL));
- scanf("%d", &arr_length);
- for (i; i < arr_length; i++){
- arr[i] = rand();
- }
- start_time = GetTickCount();
- quickSort(arr, FIRST_ELEM, arr_length - 1);
- end_time = GetTickCount();
- printf("\n%d\n", end_time - start_time);
- free(arr);
- arr = NULL;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement