Theory of Intelligence
11TH•Computer Science•Computational Structures•Queues

4.1.3 Queues

FIFO queues with enqueue, dequeue, and peek.

4.1.3 Queues

A queue is like a line in front of a bank or a ticket counter. The first person to get in line is the first person to be served. In a computer, a queue works the same way. It keeps track of things so that the first item added is the first one to be taken out. Just like in a bank line, you add things to the back and remove them from the front, following the FIFO (First-In, First-Out) principle, as shown in Figure 4.2.

Figure 4.2: Queue of persons in front of the bank

  • Front of the line (served first)
  • People waiting in order
  • Back of the line (new arrivals)

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!