Question: mplement your own Stack class. Make it a templated class. Use a vector as the underlying data store. Implement the following functions: push(T val) pop()

mplement your own Stack class. Make it a templated class. Use a vector as the underlying data store. Implement the following functions:

push(T val)

pop()

top()

size()

empty()

Test your implementation with a program that uses all the functions. Make sure your push() and pop() functions work correctly. Hint: You can use some of the vector functions to implement size() and empty().

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!