Question: //A C++ program testing the performance of static, stack and heap arrays #include #include #include using namespace std; const int MAX = 10000; //array size.
//A C++ program testing the performance of static, stack and heap arrays #include#include #include using namespace std; const int MAX = 10000; //array size. You may update this value. //static array void f1 () { static int a[MAX]; for (int i = 0; i > num; t1=clock(); for (int j=0; j
Task 1: Given the C++ program (arrayDemo.cpp) that tests the performance of three different categories of arrays. Run the program (note: you may modify the program based on your own preference) at least three times with large number of calls (say, 5000, 25,000, 50,000 - you may decide which large numbers to use). Display and observe the results, and briefly explain the results or justify your observation. Note: to more fairly calculating the execution time, you may also use the approach of averaging the computation time, for example, calculate the average computation time for each of above tasks by running the code 10 times and then take the average of the 10 test runs. (optional.) Task 2: Repeat Task 1 now with Java's array and ArrayList
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

