Question: Part 4 : Gather efficiency data Now, gather some data on how many array accesses these sorts require. Write a C + + program which
Part : Gather efficiency data
Now, gather some data on how many array accesses these sorts require. Write a C program which declares int arrays of various lengths given in the table below, and then fills the arrays with random ints between and Count the number of array accesses your sort algorithms from part and above require to sort each array. In order to make sure you didn't hit a best case or worst case value, do at least trials. In other words, randomize the array at least times for each array length and run your sort and record the number of array accesses made. Compute the average number of array accesses for sorting each array length. For part counting sort, you do not need to count accesses of the count array, just the array that you are sorting.
When you're finished, you should have a table like the one below, where you've filled in the number of array accesses for each pass and the average number of array accesses for your chosen sort algorithms. Observe the differences in growth between the algorithms as your gets larger.
tabletableSortAlgorithmtableArrayLengthtableArrayAccessesPass tableArrayAccessesPass tableArrayAccessesPass tableAverage ArrayAccessesBubbleBubbleBubbleMergeMergeMergeCountingCountingCounting
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
