Question: Write a program in C++ to do the following: Your program should perform the following: a. Randomly generate three integer arrays A1, A2, and A3
Write a program in C++ to do the following: Your program should perform the following:
a. Randomly generate three integer arrays A1, A2, and A3 of sizes N=103 , 105 , and 107 (or 106 , if your computer cannot handle an integer array of size 107 ), in that order.
b. Run all the four sorting algorithms (insertion, merge, heap and quick sort) weve learned in class on each of the three arrays A1, A2 and A3, and record the number of comparisons between array elements and actual elapsed times in appropriate time units, for instance, milliseconds.
c. Repeat b on the sorted arrays A1, A2 and A3.
d. Reverse the order of the three arrays A1, A2 and A3 and repeat b once more.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
