Build a queue out of two completely separate stacks, S1 and S2. Enqueu operations happen by pushing the data on to stack 1. Dequeue operations are completed with a pop from stack 2. Obviously you will have to find some way to get the input stack information over to the output stack. Your job is to figure out how and when to do that, using only push and pop operation
Comments
Leave a comment