资源 · 指南或文章
Priority Queue
把优先队列定义为按优先级服务的抽象类型,并把这一概念与堆区分开来,堆只是实现它的一种方式。
审核日期
打开原站: Priority Queue (在新标签页中打开原网站)练习这个主题以 技术 / 编程 模式打开练习面试官,然后在那里选择题目。
添加到路线图
把这个资源放进你正在跟进的路线图。它会作为你自己的补充资源显示;路线图的步骤不会改变,也不计入你已记录的步骤。
来源内容语言:英语
Read this in other languages: 简体中文, Русский, 日本語, Français, Português, 한국어, Українська In computer science, a priority queue is an abstract data type which is like a regular queue or stack data structure, but where additionally each element has a "priority" associated with it. In a priority queue, an element with high priority is served before an element with low priority. If two elements have the same priority, they are served according to their order in the queue. While priority queues are often implemented with heaps, they are conceptually distinct from heaps. A priority queue is an abstract concept like "a list" or "a map"; just as a list can be implemented with a linked list or an array, a priority queue can be implemented with a heap or a variety of other methods such as an unordered array.
PrepKit 概览
本概览由 PrepKit 编辑根据源代码仓库撰写并审核,并非资源本身的文字。
- 适合人群
- 来源未说明适用级别
- 形式
- 参考资料
涵盖内容
- 优先级相同时按入队顺序决定先后
- 堆与无序数组作为可能的实现方式
使用建议
这是 PrepKit 的学习建议,并非来源的说法。
分别基于无序数组和二叉堆构建两次优先队列,比较两者在插入和删除最高优先级元素时的处理方式。
范围与局限
没有操作列表、复杂度或示例。定义之外的所有内容都在两个外部链接中。
获取方式与形式
GitHub 上的简短 README,trekhleb/javascript-algorithms(MIT),附有七种译本。英文,免费。
PrepKit 于 2026年10月2日 审核。 资源来源提交: 85293e3e2b88
本概览的依据
- src/data-structures/priority-queue/README.md
收录此条目的页面
订阅 PrepKit 通讯
可选。使用 PrepKit 并不需要订阅。