On this page:
Lab 8 Description
Preamble
Stress Tests - Timing Tests
Exploration
Version: 5.2.1

Lab 8

Lab 8 Description

Preamble

Before the end of the first year when our students think they are becoming competent programmers, we want to make sure that they are aware of the true meanign of algorithm complexity. Talking and writing down formulas has little meaning in the age of lighning-fast internet.

So, we ask them to run several different solutions to the same problem and observe the differences in the time needed to complete the task.

Work on this lab, and see if we manage to help students think about this issue.

StressTests - Timing Tests

Your job is now to be an algorithm detective. The program we give you allows you to run any of the six different sorting algorithms on data sets of five different sizes using three different Comparators to produce the ordering of the data based on the given Comparator.

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:

You can now run the program. It will come up with a GUI with several buttons.

To set up the timing tests you need to go through three steps:

Exploration

Spend about fifteen minutes trying to answer some of the following questions. Finish the work later. (We ask our students to finish this at home.)

Run the program a few times with small data sizes, to get familiar with what it can do. Then run experiments and try to answer the following questions:

Copy the 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 as charts. 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.