Question DSA-QUE-0074
HardHow can a queue be implemented with a single stack and recursion?
- A.
To dequeue, pop until the stack is empty, take the bottom item, and push the rest back on the way out
- B.
It can't
- C.
Sort the stack
- D.
Push twice
Sign up free to see the answer and a step-by-step explanation.