Queue manipulation

Report a typo

Given the number n and a sequence of n queue operations, print out the content of the queue after performing them (starting from the front).

You can assume that originally the queue is empty.

Note that every element should be printed on a new line.

Tip: Use split(" ") to split the input string on the whitespace.

Sample Input 1:

4
ENQUEUE 1
ENQUEUE 10
DEQUEUE
ENQUEUE 8

Sample Output 1:

10
8
Write a program in Python 3





___

Create a free account to access the full topic