In Progress

C++ Programming Job by herculce

Template for a linked-list implementation of a stack.

Your task in this problem is to evaluate the performance of the vector and list containers of STL for various

operations (use integer values). In particular, you will measure the CPU time required for each container to perform

the following operations:

(i) Insert all the integers from 0 to 999,999 (one by one) into the back of the container.

(ii) Find the element with value 100,000 and place an iterator to point to that element (you have to manually

find the element even for the vector container).

(iii) Erase the element found in part (ii), using the erase function.

For each of the three tasks, output on the screen the CPU time (in seconds) required to complete the task for the two

different containers. In particular, perform each experiment 100 times, and output the average times (don't forget to

clear the containers before each run). Comment on the results and also include a screenshot of the output in your

report. To measure CPU time in C++, do the following:

(i) Define: time_t start,stop;

(ii) Just before the series of statements for which you want to measure the CPU time put: start=clock();

(iii) After the aforementioned statements put: stop=clock();

(iv) The CPU time in seconds is: double(stop-start)/CLOCKS_PER_SEC

Skills: C++ Programming

See more: vector template, vector stl erase, vector stl, vector iterator, vector erase, vector element, vector containers, vector container, using stl vector, using stl, the stl, template stl, template container, stl vector iterator, stl vector insert, stl vector find, stl vector erase, stl vector, stl template, stl stack, stl list vector, stl list iterator, stl list insert, stl list find, stl list erase

About the Employer:
( 8 reviews ) New York, United States

Project ID: #1270795

Awarded to:

dobreiiita

Hired by the Employer

$30 USD in 1 day
(140 Reviews)
6.1