write a javascript program to reverse stack using queue
Answers
Answered by
0
Answer:
Input : Q = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
Output : Q = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10]
Input : [1, 2, 3, 4, 5]
Output : [5, 4, 3, 2, 1]
Similar questions