Question: Use excel to create your graphs (or some other language of your choice). The data needs to demonstrate the experimental running time for Selection Sort,

Use excel to create your graphs (or some other language of your choice). The data needs to demonstrate the experimental running time for Selection Sort, Merge Sort, and the Arrays.sort() method. Here is a basic outline of this code.

1. Create several arrays of size 100, 1000, 10000, 100000, 1000000, (choose max size appropriately).

2. Start the stop watch.

3. Sort the array

4. Stop the stop watch

5. Print (or write to a file) the size of the array and the time it took to sort.

Follow the above outline for each sorting algorithm. Plot size of array (x-axis) vs time (y-axis) on a log-log scale. (This can be done easily in excel). Have all three sets of data on the same graph. (so use the same array sizes for all 3 tests). (On a log-log scale, all data should be a straight line, but the slope of a O(n2)algorithm will be higher than an O(n log n) algorithm).

Include plots on a standard scale. Create a single graph with all three sorting algorithms data on that single plot.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!