Write a method reversestack that takes as a parameter a stac
Solution
Following is the psuedo code for the required method
function reverse_stack( stack ):
queue q;
while stack is not empty:
top = top element of stack
push back top in queue q
pop the top element from stack
while queue q is not empty:
remove last element from queue q, let it be \'e\'
push \'e\' into stack
//stack is reversed
