Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clock_t start;
- vector<float> times;
- for(int i = 0; i<100; i++ ){
- vector<float> nums = {};
- nums.clear();
- for(int n = 0; n < size; n ++){
- nums.push_back((static_cast <float> (rand()) / static_cast <float> (RAND_MAX))*100);
- }
- start = clock();
- qk = quickSort(nums, 0, nums.size());
- times.push_back(clock() - start);
- }
- float totalTime = 0;
- for (float time : times) {
- totalTime += time;
- }
- totalTime = totalTime/times.size();
- return totalTime;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement