Question
Using stack In this practice, you have to use the STL vector container to develop a Stack class to store string objects. This means that
Using stack
In this practice, you have to use the STL vector container to develop a Stack class to store string objects. This means that you have to use the functions that the Vector container provide in developing the functions of your Stack class. Your Stack class should have the following functions.
void push(std::string item)
void pop()
std::string top()
int size()
bool empty()
Also, you have to try to apply your knowledge and write a good code. For instance, try to use meaningful names for your variables or try to define the function as a constant function unless it is a mutator. Finally, try to choose the private and public members of your Stack class wisely.
Using Queue
In this practice, you have to use the STL vector container to develop a Queue class to store string objects. This means that you have to use the functions that the Vector container provide in developing the functions of your Queue class. Your Queue class should have the following functions.
void push(std::string item)
void pop()
std::string front()
std::string back()
int size()
bool empty()
Also, you have to try to apply your knowledge and write a good code. For instance, try to use meaningful names for your variables or try to define the function as a constant function unless it is a mutator. Finally, try to choose the private and public members of your Stack class wisely.
Write code in C++
"Dont use ChatGpt online code please do your own way" every time they Posted Chat Gpt code. please dont use that one.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started