CSC 207 Grinnell College Fall, 2014
Algorithms and Object-Oriented Design

Algorithm Analysis


In this lab, you will analyze the complexity of some code and experimentally test your analyses.


Load into Eclipse the java programs in the following directory:

  cd ~walker/public_html/courses/207.sp12/labs/analysis is the main program that calls the other pieces ( ... allows you to conduct experiments for the subsequent exercises.

The program uses command-line input.

To supply this information, select the "Run as Configurations..." option. Once the window comes up, be sure you have selcted TestAnalysis, and select the "Arguments" tab.

For example, to run the code for Exercise 1 with n=15, you would type

  1 15
in the arguments window, and then click "Run".

Note: In this lab, a variable NUMBER_REPETITIONS is specified to repeat a segment of code NUMBER_REPETITIONS2 times. This allows reasonable timings to be compared within the accuracy of the clock.