algorithms.tutorialhorizon.com
Reverse a Stack using recursion | Algorithms
Given a Stack, write an algorithm to reverse the stack. Example: Original Stack: [14, 9, 67, 91, 101, 25] Reversed Stack: [25, 101, 91, 67, 9, 14] Approach: Use Recursion In this solution we need two recursive functions. reverse() and insert_at_bottom().