Question: Problem Statement: Based on the stackType class we develop in chapter 7, you are asked to add the following operations: 1. Modify the push operation

 Problem Statement: Based on the stackType class we develop in chapter

Problem Statement: Based on the stackType class we develop in chapter 7, you are asked to add the following operations: 1. Modify the push operation to be pushUnique, so that the duplication is not allowed in the stack. 2. Add reverseStack function as a none-member function to reverse the elements of the stack. 3. Add mirrorStack function as a none-member function to duplicate the items in the stack in reverse order. Programing Specifications: 1. Your are asked to develop a class named stackType with the following set of member functions: A class constructor to initialize the data members. The pop function to remove the item at stack top. The top function to return the value at the top of the stack. The pushUnique function to insert new value into the stack, such that a new item is pushed into the stack if and only if it is not in the stack, otherwise the push operation will fail. 1. Your are asked to develop the following none-member functions: The reverse Stack function to reverse the elements of a stack. The mirrorStack function that duplicate the content of the stack in reverse order. For example, suppose stack = {10, 20, 30, 40, 50), 10 is at stack bottom and 50 is at stack top. After a call to the function mirrorstack, stack = {10, 20, 30, 40, 50, 50, 40, 30, 20, 10). Important Notes: You are asked to implement the mirrorStack / reverseStack function using stack and queue objects only, any other structures are not allowed. (Hint : Declare stack and queue structures defined in CHSTL) Submission Notes: Late assignments will NOT be graded. > Once finished, compress your code and upload it into your elearning account. Your assignment must compile in order to be graded. The CPP file should have your name, ID, Section, and a short description about the project Comment should be written all over the program

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!