Skip to main content
2 of 5
edited body
manlio
  • 4.2k
  • 3
  • 26
  • 37

It's a bounded queue (a first-in-first-out queue with a fixed capacity).

This particular queue always allows addition of elements and silently remove head element for newly added element (when full).

In Java there is the CircularFifoQueue that works exactly this way (see also Size-limited queue that holds last N elements in Java).

manlio
  • 4.2k
  • 3
  • 26
  • 37