What is the correct term for a fixed-size FIFO queue?

What is the correct name for the following data structure? It:

  • Fixed Queue
  • New items are added to the beginning.
  • Whenever a queue rises above a certain size, the number of elements is removed from the end.
+6
collections data-structures queue fifo
source share
5 answers

I think it may depend on the actual implementation of this. A practical example of what you are describing is a Circular Buffer or Ring Buffer, where the oldest data is overwritten with new data after the buffer is full. This would be one of the traditional ways of implementing such a data structure in something like C.

EDIT: Good, so the circular buffer is not suitable. What about buffer end queue or queue end capacity ? But they do not cover the self-limiting aspect ...

Self-limiting ultimate power of Bratt Queue.

Auto Negotiation ...

My point is that I don’t think that there is an official name for the data structure with the exact properties that you mention, so you can also do this based on the data structure that is closest to it, possibly in combination with Some of your structures have unique properties. It will probably be rather verbose, though ...

EDIT: Or maybe it's a Loop Queue . The article describes this as:

This article describes a queue similar to System.Collections.Queue, except that it has> a fixed buffer size. This means, of course, that the buffer cannot be large enough to> hold all the items added to the queue, in this case the oldest items are deleted.

... which is very similar to yours. Nice and concise.

+1
source share

"fixed size FIFO queue"

Sometimes a buffer, sometimes a circular buffer (as usually implemented). I don't know anything that means your strategy for removing items in batches, although this is not uncommon.

+2
source share

this is a circular buffer

+1
source share

In hardware, a similar structure is called a shift register .

0
source share

In embedded systems, this is almost universally called circular buffers.

0
source share

All Articles