Question: Please use C for coding Completing the Program (15 points) This program prints a table of runtimes (these are displayed in seconds) for given functions

Please use C for coding

Please use C for coding Completing the Program (15 points) This program

prints a table of runtimes (these are displayed in seconds) for given

Completing the Program (15 points) This program prints a table of runtimes (these are displayed in seconds) for given functions on arrays. The program tests different array sizes to establish a relationship between input size and runtime. It tests each array size multiple times and then takes an average of the times. We also output how much the average runtime increased relative to the previous average. This is calculated by dividing the current average by the previous average (output "N/A for the first increase value). Here are example calls to the timing functions: functionRuntimes fRT; int sizes1[] = { 2000, 4000, 8000, 16000, 32000, 64000, 128000, 256000); srand(time(0)); fRT = timeAlgorithm ("Insertion Sort", 6, 5, sizes1, insertionSortInitial ); printRuntime Table (fRT); freeFunctionRuntimes (fRT); fRT = timeAlgorithm ("quicksort", 12, 8, sizesi, quickSortOptInitial ); printRuntime Table (fRT); freeFunctionRuntimes (fRT); This results in following table: Test #2 0.008 0.630 0.119 0.471 1.902 Test #3 0.007 0.038 8.119 8.476 1.926 Test 4 0.008 0.030 0.119 0.474 1.922 Test is 0.000 0.030 0.120 0.475 1.917 Test 06 0.000 0.030 0.120 0.476 1.981 Average 0.000 0.030 0.119 0.476 1.924 Increase N/A 3.950 3.939 3.985 4.043 Insertion Sort Test size Test #1 2000 0.008 4000 0.031 3000 8.120 16000 8.484 32000 1.895 quicksort Test size Test 1 2000 0.000 4000 0.001 8000 0.002 16000 0.004 32000 0.008 64000 0.017 128000 0.035 256000 0.076 Test #2 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Test #3 0.000 0.001 0.002 0.004 0.008 0.017 0.034 0.071 Test 44 0.000 0.001 0.002 0.004 0.008 0.016 0.035 0.071 Test 5 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Test 46 0.000 0.001 0.002 0.004 0.008 0.018 0.035 0.070 Test 7 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Test 18 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Test #9 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.072 Test 10 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Test 11 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Test #12 0.000 0.001 0.002 0.004 0.008 0.016 0.034 0.071 Average 0.000 0.001 0.002 0.004 0.000 0.016 0.034 0.071 Increase N/A 2.027 2.055 2.124 2.071 2.100 2.686 2.076 Note your runtimes will vary a bit since the test data is randomly generated. The runtimes are stored in a functionRuntimes struct. You are completing a program to create and fill data in this struct, print the data of this struct, and free this struct. You are given a partial implementation in the file runtime Table.c. Specifi- cally you are tasked to complete the functions below the heading "Functions for finding and printing runtime. No other functions should be changed. Using the Program (5 points) After you have the program completed, you should use it to help determine the asymptotic runtimes of the three mystery functions (i.e., mysteryRuntimel, mysteryRuntime2, mysteryRuntime3). Be sure to also examine the code of the mystery functions to confirm/improve your estimations Fill in the following table in the provided file: /* TODO: Give your asymptotic estimates for the runtimes of the following 3 functions: mysteryRuntime1: 0 mysteryRuntime: 0 mysteryRuntime: 0 */ ) > >

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!