Implementing a Queue using two Stacks

We have seen how to implement Queue using a linked list and using Array as the base data structure.  The question here is that given two Stacks, say S1 and S2, and no other data structure, simulate the functionality of a Queue, hence use two stacks as the base data structure for a Queue. i.e […]