write a program to display the running time of the different sorts. Test the sor
ID: 3932855 • Letter: W
Question
write a program to display the running time of the different sorts. Test the sorts on arrays of various sizes. Arrays of the same size should contain identical entries Use the function clock from <ctime> to time each sort.
Explanation and specifics:
You are to compare the relative performance of different sorting algorithms on the same data set and the same algorithm on different data sets.
Choose a sorting algorithm from each of the O(n^2) (i.e., selection, insertion and buble), O(n logn) (i.e., merge and quick), and O(n) (i.e., counting, bucket and radix) categories.
Randomly generate (1000, 10000, and 100000) integer values (in the range of 0 to 1000000) to be inserted into the data structures. Note that the list (i.e., the input values) itself should not be sorted and all algorithms should use the same input file when the input size is same.
Also, test the speed of algorithms when the input array is already sorted (for the same input data).
The following output should be provided for an average of 10 sorts of each algorithm and input size:
1. the CPU time (note that generation processes should not affect these values)
2. the number of comparisons
3. the number of swaps
/**Then run the algorithms with 1000000 values.
*
*You can run 2 instances of algorithms that take more than one hour.