Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

Have you laid out a timeframe for refreshing the data regularly?

Answered: 1 week ago

Question

Question What is a secular trust?

Answered: 1 week ago