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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started