Hi sir,
I concern that if we use 1 extra stack to reverse a stack, why don’t we just pop all out from the original stack and push them element by element to the extra stack? Then we just need to print the data of the extra stack.
I don’t know why we have to pop each element and then transfer the rest to the other.
Thanks a lot for your help.
My code for this: http://cpp.sh/8uvd3