queues another fundamental data structure is the queue it is close "cousinof the stackas queue is collection of objects that are inserted and removed according to the first-infirst-out (fifoprinciple that iselements can be inserted at any timebut only the element that has been in the queue the longest can be next removed we usually say that elements enter queue at the back and are removed from the front metaphor for this terminology is line of people waiting to get on an amusement park ride people waiting for such ride enter at the back of the line and get on the ride from the front of the line there are many other applications of queues (see figure storestheatersreservation centersand other similar services typically process customer requests according to the fifo principle queue would therefore be logical choice for data structure to handle calls to customer service centeror wait-list at restaurant fifo queues are also used by many computing devicessuch as networked printeror web server responding to requests tickets (aer ent all call queue (bfigure real-world examples of first-infirst-out queue (apeople waiting in line to purchase tickets(bphone calls being routed to customer service center