Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

////////////////////////////////////////////////////// // Topics: circular array

ID: 3881770 • Letter: #

Question

 ////////////////////////////////////////////////////// // Topics: circular arrays, templated classes, dynamic arrays // // Implement a stackQueue using a // circular array implementation as discussed in class. // Your data structure must increase its array size dynamically // if the array runs out of room. // // Abstractly, your stackQueue represents a list of items // with a front and back from which items may be added // or removed.  If you choose to add and remove from just // one end, you effectively have a stack.  If you choose // to add to the back and remove from the front, (or vice versa) // you effectively have a queue, thus the name "stackQueue". // // Please add comments and be detailed, thank you! Will rate (: ///////////////////////////////////////////////////////  template  class stackQueue { private:     //declare your array variable and     //any additional variables you need     //to solve the problem  public:     stackQueue()     {}      //Insert x to the "back" of the list of items.     void addBack(T x)     {}      //Add x to the "front" of the list of items.     void addFront(T x)     {}      //Remove and return the item currently at the "back" of the list     T removeBack()     {}      //Remove and return the item currently at the "front" of the list     T removeFront()     {}      //Is the stackQueue empty?     bool empty()     {} }; 

Explanation / Answer

/*All the above if and else conditions have made the index where the last element coming has to be put empty, that is the value of end, thus we can here directly assign value at end index*/

/*All the above if and else conditions have made the index where the first element coming has to be put empty, that is the value of front ,thus we can here directly assign value at front index*/