Question: This project requires that you know how to determine the actual time taken for a func- tion to execute. Write a test program for the
This project requires that you know how to determine the actual time taken for a func- tion to execute. Write a test program for the bag class from Section 10.5. The program should allow the user to specify an integer, n. The program adds n randomly selected integers to a bag and then counts the number of occurrences of each integer between 1 and n, keeping track of the amount of time needed for the entirety of these operations. Also use the test program to test one of the earlier bag implementations. Graph the results of your tests on a plot that has elapsed time on the y-axis and n on the x-axis. (In the next chapter, we will do an anal- ysis to explain these times.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
