This project requires that you know how to determine the actual time taken for a method to

Question:

This project requires that you know how to determine the actual time taken for a method to execute. Write a test program for the bag class from Section 9.5. The program should allow the user to specify an integer n. The program then adds n randomly selected integers to a bag and 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 analysis to explain these times.)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: