Priority Queue 優先權佇列
- 2021.12.26
- Data Structure heqpq Priority Queue
定義
當 pop() 時,會遵守:
- queue的特性:先進先出(first in, first out)
- 優先權 大/小 的優先 pop (max/min-priority queue)
用 Binary Heap 實作 Priority Queue
[Python] 使用 heapq
Last Updated on 2023/09/06 by A1go