Lab 12     ©2011 Felleisen, Proulx, Chadwick, et. al.

Stress Tests; Heapsort

 

12.1  Goals: StressTests - Timing Tests

Your job for this lab is to be an algorithm detective. The program we provide allows you to run one of six different sorting algorithms on data sets of different sizes using three different Comparators to define the ordering of the data. When you run the program, the time that each of these algorithms took to complete the task is shown in the console.

To run the program you need to do the following:

Exploration

Now try to answer some of the following questions. Finish this work as a part of the Assignment 12.

Run the program a few times with small data sizes, to become familiar with its behavior and the approximate times. Then run experiments and try to answer the following questions:

  1. Which algorithms run in mostly quadratic time, i.e. O(n2)?

  2. Which algorithms run in mostly O(n.logn) time?

  3. Which algorithms use functional style (immutable) Cons lists? Explain how you came to that conclusion.

  4. Which algorithm is selection sort? Justify your answer.

  5. Why is there a difference when the algorithms use a different Comparator? Where do you see this difference most prominently and why?

Copy the timing results into a spreadsheet. You may save the result portion in a text editor with a ".csv" suffix and open it in Excel (or some other spreadsheet of your choice). You can now study the data and represent the results for different sizes as a chart. Do so for at least three algorithms, where there is one of each — a quadratic algorithm and a linear-logarithmic algorithm.

Produce a report with a paragraph that explains what you learned, using the Excel charts to illustrate this.

Your report should have a professional look – typed, computer generated charts, reasonably organized. It does not have to be more than 2 pages long, one page is OK.

Last modified: Tuesday, April 5th, 2011 1:07:59am