initial.cppimplements this experiment.
Timer.txtimplement the timer required by all experiments (there is no
For this experiment, the test is to create and (implicitly)
All we do is allocate new containers; Perform the test is left empty.list<int> theList(n); vector<int> theVector(n);
Creating a new container does take time; there's some work involved — perhaps a lot if the container is initialized to some rather large size. Because we'll be creating these containers for the other tests, we want to find out how costly it is to construct an n-element container.
Compile and execute the program on the sample range of n.
Record your results in a spreadsheet and graph them as described in the main lab exercise.
Here are three different categories of performance measures that are used in computing:
There are additional categories (e.g., logarithmic, cubic, exponential, factorial, etc.), but these three are all that we will see in this exercise.
Use these definitions to do some categorization of your results:
Question #13.1.1: How would you categorize the time it takes to create an n-element
list? Justify your answer.
Question #13.1.2: How would you categorize the time it takes to create an n-element
vector? Justify your answer.
Justification for your categories should describe the graph: