Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- setlocale(0, "");
- int i;
- int* arr = new int[MAX];
- srand(time(NULL));
- for (int i = 0; i < MAX; i++)
- {
- arr[i] = MAX - i;
- // cout << arr[i] << " ";
- }
- // for (i = 0; i < MAX; i++)
- // arr[i] = i + 1;
- start = clock();
- random_shuffle(arr); //To randomize the array
- quick_sort(arr, 0, MAX - 1); //sort the elements of array
- // for (i = 0; i < MAX; i++)
- // cout << arr[i] << " ";
- cout << endl;
- timing = (float)(clock() - start) / CLOCKS_PER_SEC;
- delete[] arr;
- cout << "Время сортировки массива = " << timing;
- cout << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement