CPE 103 Sort Timing Study
The goal is to compare the runtime performance of three different
sorting routines.
Be sure to time only the sorting, not reading or
outputing of data.
We want to compare the performance of the three sorts using several
different sized sets of data, for example, 10,000, 20,000, 50,000,
75,000 items. Use larger datasets if necessary to yield
results measurable in tenths of a second (ideally). Run each dataset
several times and compute the
average.
Weiss's
class
has a main method that illustrates how to create a random set of
integers. You may use this code or modify it to suit your
purposes.
Create a table to show the output from your experimental trials.
Sort Type
|
list size
|
seconds
|
Insertion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mergesort
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Collections.sort
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you have time you might experiment with some more realistic data:
Use the
famous names or
text
file containing "Huckleberry Finn" as the data to be
sorted.
Submit a document containing the table above and a brief
analysis. Compare your
results with expected behavior, interpreting the results you
obtained
compared with the theoretical prediction. Explain any unexpected
behavior. Submit a PDF to PolyLearn. (Please have the
person listed in the left-hand column of Partner
Assignments submit the report for the team.)