In Progress

C++ template for a linked-list implementation of a stack

What to submit: For each program, you should discuss briefly how you designed it. This may be done by providing

a simple piece of pseudo-code, and/or describe your considerations, concerns, and the problems that you have

encountered during coding and debugging. For each program, you should turn in a hard-copy (i.e., printed version)

of your code (including the discussion) during class. Also, in each program, you should include appropriate

comment lines to describe the source code. Missing discussions and/or comment lines in the program will result in a

deduction on your grade for this assignment.

Plagiarism: If two or more submitted projects are identical, except for some minor variations, then a score of zero

will be assigned to all identical projects.

1. Write a class template for a linked-list implementation of a stack. The Stack class must have the same function

prototypes as the ones used in page 15 of Lecture 8, but with four additional functions: destructor, copy constructor,

overloaded assignment operator, and deepCopy. The private section shall only have one data member: a pointer

called top. Be sure to have the pointer of the last node (at the bottom of the stack) set to NULL at all times. (This

condition wasn't necessary in the linked-list implementation of the queue, because the back pointer signified the last

node but it is generally necessary in linked lists). At the top of the class implementation file, include iostream

(important because NULL is defined here) and use the std namespace.

2. 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: template stack linked list, program various operations stack using linked implementation, template linked list implementation, template linked list, grade report linked list, write program class template using linked list, linked list template, stack using linked list, list implementation, program using template stack class linked list, stack template, implementation stack using linked list program, stack implementation using template output, stack template list, implementation stack using list, template stack using linked lists, template stack class using linked list, linked list coding implementation, template list implementation, what is template in c, what is stl, what is programming used for, what is linked in, what is c programming used for, what is an assignment problem

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

Project ID: #1273582

Awarded to:


Dear,sir. I can do it right now. Regards.

$30 USD in 1 day
(47 Reviews)

7 freelancers are bidding on average $58 for this job


Please check PMB.

$80 USD in 2 days
(35 Reviews)

Hello. I can help you with stack implementation.

$65 USD in 1 day
(9 Reviews)

Hi, I am a graduate in CS and working as a programmer in c++ platform. I have implemented several STL containers manually, so this job best fits with my expertise. I assure you of quality product with clear,simple and More

$70 USD in 1 day
(8 Reviews)

Hello please check your PMB. Greetz

$60 USD in 2 days
(1 Review)

Simple problem, can be done quickly. Will provide psuedocode, explanations and reasoning behind design for brief discussion.

$50 USD in 1 day
(0 Reviews)

24 hrs or less and you'll have your program ready

$50 USD in 1 day
(0 Reviews)

Ready to help you. I have already successfully completed this assignment some years ago when I was at school ;)

$50 USD in 1 day
(0 Reviews)