Question: Manipulate a queue according to the given insert and remove commands and then output the number that is at the front of the queue. If

Manipulate a queue according to the given insert and remove
commands and then output the number that is at the front of the
queue. If a remove command is issued for an empty queue then
nothing should happen. In your answer you should provide the
full queue class.
Input Format
A series of lines involving either INSERT or REMOVE
commands. The command INSERT is followed by a space and
then a number to insert (e.g. INSERT 56).
Output Format
Output the number that is at the front of the queue following the
given commands. If the queue is empty then output 0.
Sample Input
INSERT 56
INSERT 33
REMOVE
INSERT 83
REMOVE
Sample Output
 Manipulate a queue according to the given insert and remove commands

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!