Queue
Imagine that you are a British person waiting in a queue at a bus stop after a nice cup of tea with biscuits. The first person to arrive at the bus stop will be the first to enter the bus. Therefore this phenomenon can be described by the queue container, since it is a FIFO (First In First Out) container.
Queue has these operations:
push
, which inserts an element at the end.pop
, which removes the first element.front
, which returns the first element.back
, which returns the last element.empty
, which returns whether the queue is empty or not.size
, which returns the number of elements stored in the queue.To use the queue implemented in the C++ standard library, include the
Your task is to create an interactive program using an integer queue which accepts the following commands:
push 10
push 20
push 30
size
front
back
empty
3
10
30
false