[prev] 88 [next]

Stack vs Queue

Queue, aka FIFO data structure (first in, first out)

Insert and delete are called enqueue and dequeue

Applications:

  • the checkout at a supermarket
  • people queueing to go onto a bus
  • objects flowing through a pipe (where they cannot overtake each other)
  • chat messages
  • web page requests arriving at a web server
  • printing jobs arriving at a printer