Solution Review: Reverse a Stack
This review provides a detailed analysis of the solution to reverse a stack using recursion.
We'll cover the following...
We'll cover the following...
Solution: Using Recursion
Explanation
A simple solution to reversing a stack is to create another stack. Pop elements from the old stack into the new stack and we will have the reversed contents in the new stack.
However, the problem statement asked us specifically to not use any other data structure or stack. ...