Suppose that items A, B, C, D and E are pushed in the order, onto an initially empty stack S. S is then popped 4 times; as each item is popped of, it is inserted to an initially empty queue. If two items are then removed from the queue, what is the next item that will be removed from the queue?
Comments
Leave a comment