[A6] Queue from Two Stacks (2 pts) [00TA]

Describe how to implement a queue using two stacks and O(1) additional memory, so that the amortized time for any enqueue or dequeue operation is O(1). The only access you have to the stacks is through the standard methods \mathsf {Push}, \mathsf {Pop}, and \mathsf {IsEmpty}; in particular you should not assume anything about how the stacks are implemented. You may assume that \mathsf {Push}, \mathsf {Pop}, and \mathsf {IsEmpty} take O(1) time in the worst case.