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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started