优先队列:一种抽象数据类型/数据结构,用于存放元素,并允许按“优先级”取出元素。通常每次取出的是优先级最高(或最低,取决于约定)的元素,而不一定遵循先进先出(FIFO)。常见实现包括二叉堆(heap)等。
/praɪˈɔːrəti kjuː/
A priority queue always removes the most important item first.
优先队列总是先移除最重要的项目。
In the scheduler, tasks are inserted into a priority queue so that urgent jobs run before background work, even if they arrived later.
在调度器中,任务被插入优先队列,使紧急作业能在后台工作之前运行,即使它们更晚到达。
priority 来自拉丁语 prior(“更早的、在前的”),引申为“优先级、重要性顺序”;queue 源于法语 queue(“尾巴”),在英语中表示“队列”。合起来 priority queue 字面意思是“按优先级排列的队列”,强调“按重要性出队”而非按到达顺序。