Lab 7: Benchmarking Continued

Overview

In this assignment, you incorporate feedback on your previous lab submission from your instructor (if available), and do more thorough asymptotic time complexity analysis. You will then generate plots of your benchmarking results and compare them with your time complexity analysis.

In addition to incorporating feedback from your instructor, if available, modify your program to

Video introduction for the lab

Assignment

Asympototic Time Complexity Analysis

Create a Word document and provide Big-O analysis for the following operations:

You may need to study the code in the datastructures classes in order to do this analysis. Be sure to justify your reasoning.

Named Command Line Arguments

By supporting named command line arguments, you can place the arguments in any order. Your program must use the following names:

See the Application.Parameters class documentation for how to access named parameters. The method you need to call returns a reference to a Map<String, String>. You should find the get(String) method useful.

When named command line arguments are supported, your program can be called as follows:

java -jar lab7username.jar --output=plots/containsLL.png --implementation=java.util.LinkedList --startSize=10000000 --operation=contains --numberOfSamples=7 --divisor=5

Ploting Benchmarking Results

Generate a benchmark chart for each of the scenarios above, and save each graph as a .png image in a folder called plots in the project folder. The images should be named:

Generating line graphs is surprisingly easy in JavaFX. JavaFX Line Charts provides nice example code for how to generate these graphs.

Saving the Graph to a PNG

Once the graph has been added to your scene, you can save it to a file. The following code shows how:

WritableImage image = scene.snapshot(null);
File file = new File(filename);
ImageIO.write(SwingFXUtils.fromFXImage(image, null), "PNG", file);
In order to capture the values on the axes, you'll need to call lineChart.setAnimated(false); before calling lineChart.setTitle();. You should also call lineChart.applyCss(); and lineChart.layout(); after the chart has been added to the scene and after all of the data has been added to the line chart.

Big-O and Benchmarking Comparison

Add these charts to your Word document. Discuss how your Big-O analysis compares with the benchmarking results.

Acknowledgement

This laboratory assignment, developed by Dr. Chris Taylor.

See your professor's instructions for details on submission guidelines and due dates.