This problem is from the book Algorithms, 4th Edition.
Queue with three stacks. Implement a queue with three stacks so that each queue operation takes a constant (worst-case) number of stack operations.
Warning : high degree of difficulty.
When I search the Internet to find a solution, I find varieties of …more ...