HW8: Timing Sorting

25 points; due Mon 4/28 @ 11am.

Goals

To study the performance characteristics of a handful of sorting algorithms.

Your Task

This assignment may optionally be done with a partner.

In this assignment, most of the code is provided for you. You will just have to fill in one method, the one that does Shell sort. Your task is then to run some experiments, investigate your results, and write up a report of what you found.

Download Sorter.java and take some time to study it. It's a big program, but it has basically four components:

For a given value $n$, we can generate an array of $n$ unique integers in random order, and then sort it with a chosen sorting algorithm. The question at hand is this: what's the relationship between $n$ and the running time, for each different algorithm? How do the algorithms compare to each other? What predictions can we make about really huge values of $n$?

One way to investigate this question is by timing the algorithms for various values of $n$, and making graphs of the timing results. That's what you'll do for this assignment.

What to hand in

Hand in via Moodle:

You will be graded on the depth of your investigation and the clarity of your writeup. Try to figure out if there's an explanation for the results you see. You have an assigned reading this weekend, Chapter 4 (actually just 4.1—22), which defines a mathematical language for talking about performance figures like this.

Specifically, please address the following questions:

Suggestions and offerings

Submission and Grading

Create a zip file called hw8.zip containing your writeup (which must be a PDF file, no exceptions!) and your Sorter.java file. Submit the zip file on Moodle.

Start early, ask lots of questions, and have fun!

Grading

This assignment originally designed by Jeff Ondich. Thanks for sharing, Jeff!