main.cpp Include all needed libraries for timing and random number generation while the number of element, N, is less than 100001 repeat the following create an array with N (initially 10) random elements sort the same array with Bubble and Merge sort time how long it takes each algorithm in microseconds (see example below) Increase N by a factor of 10 (N *= 10) Hint: you may want to put your merge sort object on the heap and delete it with every iteration of this loop |
|
|
std::cout << "Sorted in " << ((double)(std::clock() - start) / CLOCKS_PER_SEC) << " seconds.\n";