A queue is a first-in, first-out (FIFO) collection. Basic operations are
Dequeue, respectively, to add an element to the end of the queue and to retrieve the first element in the queue. Compare this to a queue in the supermarket: If you’re in front, you are served first. Figure 16.3 illustrates the principle of a queue’s operation.
The following is a real-world example of a queue:
var postOffice = new Queue();postOffice.Enqueue(new Person("Bart", 10));postOffice.Enqueue(new Person("Homer", 38));postOffice.Enqueue(new Person("Ned", ...