Question: Pseudocode also needed and time complexity for each operation. Implement pseodocode in the template in stackQueue.h Explain the design choices as well. Coding exercise In

Pseudocode also needed and time complexity for each operation.

Implement pseodocode in the template in stackQueue.h

Explain the design choices as well.

Pseudocode also needed and time complexity for each operation. Implement pseodocode inthe template in stackQueue.h Explain the design choices as well. Coding exercise

Coding exercise In this exercise, you will implement a queue using two stacks Create a template called template typename elemType> class stackQueue( 1); in a file called stackQueue.h with two fields of type stack (you can use the STL stack here. If you want to use your own implementation, that is fine too). Other fields should not store queue elements. Note that the stacks can only support push and pop operations to add/remove items from the data structure. You may use auxiliary data structures within the member functions. The template should support the following functionality: 1. 2. a. void enqueue (elemType element) - insert an element at the back of the queue b. elemType dequeue-remove the element from the front of the queue and return the value c. elemType front () -return the value at the front of the queue. Do not delete it. d. int size () - returns the size of the queue e. bool isEmpty )-returns true if queue is empty, false if not f. bool isFull )- returns true if queue is full, false if not (Does this ever return true?) Write the pseudocode and the time complexity in big-O notation for each of the above operations in a file called stackQueue.pdf. Please explain your design choices as well. 3. 4. Implement the pseudocode in the template in stackQueue.h. 5. Test your code using main.cpp. A sample main.cpp is provided to you. You are required to edit it and test for other cases as well

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!