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 eg INSERT
Output Format
Output the number that is at the front of the queue following the
given commands. If the queue is empty then output
Sample Input
INSERT
INSERT
REMOVE
INSERT
REMOVE
Sample Output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
