固定大小的 FIFO 队列的正确术语是什么?

发布于 2024-07-22 01:51:44 字数 109 浏览 12 评论 0原文

以下数据结构的正确名称是什么? 它是:

  • 固定大小的队列
  • 新元素被添加到开头
  • 每当队列超过一定大小时,就会从末尾删除一些元素

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

  • A queue of fixed size
  • New elements are added to the start
  • Whenever the queue gets above a certain size a number of elements are removed from the end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

燃情 2024-07-29 01:51:44

“固定大小的 FIFO 队列”

有时是缓冲区,有时是环形缓冲区(因为这就是通常实现的方式)。 我不知道任何表明您批量删除项目的策略,尽管这并不罕见。

"a fixed sized FIFO queue"

Sometimes buffer, sometimes ring buffer ( as that's how it's normally implemented ). I'm not aware of anything which denotes your strategy for removing items in batches, though it's not uncommon.

野稚 2024-07-29 01:51:44

我认为这可能取决于实际执行情况。 您所描述的一个实际示例是 循环缓冲区 或环形缓冲区,其中最旧的数据被覆盖一旦缓冲区已满,就可以接收新数据。 这将是用 C 等语言实现此类数据结构的传统方法之一。

编辑: 好吧,所以循环缓冲区不太适合。 有限缓冲区队列有限容量队列怎么样? 但这些并没有真正涵盖自限制方面......

自限制有限容量布拉特队列。

自动弹出...

我的观点是,我认为具有您提到的精确属性的数据结构没有一个正式名称,因此您不妨根据数据来编一个名称最接近它的结构,也许与您的结构的一些独特属性相结合。 不过,它可能会非常冗长...

编辑:或者可能是循环队列。 文章将其描述为:

本文描述了一个类似于System.Collections.Queue的Queue,只不过它有> 固定的缓冲区大小。 当然,这意味着缓冲区不能足够大以> 保存添加到队列中的所有项目,在这种情况下,最旧的项目将被删除。

...这听起来很像你的。 又好看又简洁。

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

EDIT: Ok, so the Circular Buffer doesn't quite fit. How about Finite Buffer Queue, or Finite Capacity Queue? But those don't really cover the self-limiting aspect...

Self-limiting Finite Capacity Bratt Queue.

Auto-popping...

My point being that I don't think there's an official name for a data structure with the exact properties that you mention, so you might as well make one up based on the data structure that nearest resembles it, perhaps combined with some of your structure's unique properties. It's probably going to be pretty wordy though...

EDIT: Or perhaps it's a Cyclic Queue. The article describes it as:

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

...which sounds a lot like yours. Nice and concise too.

哆兒滾 2024-07-29 01:51:44

在硬件中,类似的结构称为移位寄存器

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

半世蒼涼 2024-07-29 01:51:44

在嵌入式系统中,这几乎普遍称为循环缓冲区。

In embedded systems, this is almost universally referred to as circular buffers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文