Interview Question – Stack

Given a stack containing n elements reverse the stack with the help of an empty stack. import java.util.Stack; public class StackReversal { public static void reverseStack(Stack<Integer> stack) { if (stack.empty())…

0 Comments