a. Add the following operation to the class stackType :
void reverseStack(stackType&otherStack);
This operation copies the elements of a stack in reverse order onto another stack.
Consider the following statements:
stackTypestack1;stackType stack2;
The statement
stackl.reverseStack(stack2);
copies the elements of stack1 onto stack2 in reverse order. That is, the top element of stack1 is the bottom element of stack2 , and so on. The old contents of stack2 are destroyed and stack1 is unchanged.
b. Write the definition of the function template to implement the operation reverseStack .
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.