A queue implements FIFO
(first-in first-out) ordering.
It uses the operations:
add(item)
: Add an item to the end of the listremove()
: Remove the first item in the listpeek()
: Return the top of the queueisEmpty()
: Return true if and on if the queue is empty
There are several places that we can use Queue but it may appear in Cache or Breadth-first search the most.