Homework 7
CS1210 Computer Science 1 - Fall 2021
Due Monday, Nov. 8, by 2:00pm
6 points

1. Compare six sorting methods and produce a document discussing your results. You will be graded on the quality of your test data, the effectiveness of your charts/graphs, and your written discussion of the results.

Start with the code in hw7sorts.py. The file includes four sorting methods: selection, insertion, merge, and builtin (Python's built-in sort), plus some commented-out pylab code that can serve as a model for your graphing/charting code.
Your report must have three sections:
  1. Comparison of all sorts on random data. This section should have two charts, one for all the sorts or just the relatively slow sorts, with data up to sizes in the tens of thousands. You won't likely be able to see much difference between the faster sorts on this first chart. The second chart should be just for the faster sorts on data up to sizes of hundreds of thousands or even millions of items.
  2. Comparison of all sorts on already sorted data. Again, there should be two charts.
  3. Comparison of all sorts on reverse sorted data. Again, there should be two charts.
For each of these sections, write a couple of a sentences explaining what the charts tell you about the sorting methods and how the charts match with expected O(n), O(n log n), O(n^2) behaviors of the methods.

Note: You may include more analysis, additional data and charts if you wish, but the above is what's required for full credit.
For this assignment, submit two things:
  1. one Python file containing everything in the original hw7sorts.py plus what you added - the code you used to generate your test data, timing results, and graphs/charts, and the additional sorting methods.
  2. a pdf document containing your write-up. NOTE: .doc,.rtf, and similar documents are not acceptable! Convert to pdf before submitting (via "Save As" or similar means)