CMIS 240
Week 14 Exercise. No need to submit it.
Conducts experiments of the common sorting methods.
Use the sortsdr.cpp and sorts.cpp files in Chapter10/.
In the program the data to be sorted are random integers. The user
specifies the number of integers to be sorted, up to a maximum of
1,000,000 (if your compiler can't handle that, reduce
accordingly). That number of random integers is generated into an
array. The array is sorted by whichever method the user chooses. The
user has the option of viewing the unsorted and/or sorted versions of
the array.
For data set sizes of 1000, 10000, and 100000 obtain the CPU time
used, the number of data moves, and the number of key comparisons
(which are NOT index comparisons) made for each sorting method.
Note that a swap counts as three moves, and an assignment is just one
move. To ensure average cases take the average of sorting different
data sets of a given size for those sorting methods whose amount of
work is dependent on the initial order of the data (that is, all of
them except selection sort). You'll see the O(N**2) behavior of the
slow sorts, and the O(NlogN) behavior of the more efficient sorts.
Submit your experiment's data (i.e. your measurements, not the numbers
that were sorted) as a well-formatted text file (meaning one can read
and interpret your experiment's results at a glance).