Code doubt ..please resolve

in reversing the queue through recursion code we haven’t used any helper queue…if we do "reversing the stack through recursion " in a similar fashion without using helper stack…will it give the same stack back without reversing the stack or will it reverse the stack?

@himanshuep32,
In a queue, the element inserted at the first, is the first element to come out of the list.

In a stack, the element inserted at the last, is the first element to come out of the list.

Hence we need a helper stack to reverse a stack.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.