Search for question
Question

10. [10 points] Simulation problem. (i) Simulate a stack using queue(s). That is, show how to implement Push and Pop functions of stack using Enqueue and Dequeue methods of queue(s). (ii) Simulate a queue using stack(s). That is, show how to implement Enqueue and Dequeue functions of queue using Push and Pop methods of stack(s).

Fig: 1