Lab 10

April 1, 2004

Partners

You may work with at most one other person on this assignment. If you do, you will both receive the same grade.

QuickSort Code Base

Copy the code that we covered in lecture on Wednesday, March 31st into two BlueJ projects. Name one of these projects Original and one Modified.

Part I: QuickSort Modification, 10 points

Change the Modified project so that quicksort selects the pivot by using the median of the first, middle, and last elements of the partition to be sorted.

Once you are certain this is working, call over either the lab TA or one of the consultants. The checker will first examine your code to make sure that you are choosing the pivot correctly. If you are, the checker will run your program 3 different times with arrays of size 100 and make sure that the output sorts correctly each time. The checker will report the results to the lab TA.

Part II: Experiment, 10 points

Formulate and conduct a sound experiment to make a convincing case that the Modified project is a superior implementation of QuickSort compared to the Original project.

Write a document that includes the following sections:

  1. An explanation and rationale for the experiments you conduct.
  2. The results of your experiments and an interpretation of what these results show.
  3. Any flaws or limitations regarding your experiments.
  4. An explanation (in English) of how you modified your code to conduct the experiments.

What to Submit

  1. Your report.

Before You Leave Lab

Delete the BlueJ projects that you created and empty the recycle bin. Thanks!

Valid XHTML 1.0!