Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If you have your own code to solve the problem then that's alright. For this lab assignment you will need to write some code and

image text in transcribed

If you have your own code to solve the problem then that's alright.

For this lab assignment you will need to write some code and create some graphs. You may use excel to create your graphs, or other language of your choice. Your data needs to demonstrate the experimental running time for Selection Sort (code in book), Merge Sort (code in book), and the Arrays.sortO method. Here is a basic outline of how you need to code this assignment. 1) Create several arrays of size 100, 1000, 10000, 100000 1000000, (you need to choose max size appropriately). 2) Start the stop watch (class provided in book) 3) Sort the array 4) Stop the stop watclh 5) Print (or write to a file) the size of the array and the time it took to sort You will follow the above outline for each sorting algorithm. You will need to plot size of array (x-axis) vs time (y-axis) ona log-log scale. (This can be done easily in excel). You should 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(n) algorithm will be higher than an O(n log n) algorithm). I have an example shown below of a graph of 3 functions on a log-log scale You also need to include plots on a standard scale. Create a single graph with all three sorting algorithms' data on that single plot You may print your values to the screen and copy / paste into excel. Or you may create CSV files and open them directly with excel. (CSV file is simply a text file, with values separated by commas-CSV stands for Comma Separated Values)

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

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions