python队列、缺省字典、排序字典
import heapq
class PriorityQueue:
def __init__(self):
self...._=='__main__':
# 优先队列,heapq库
# heappush(heap, x) 将x压入堆中
# heappop(heap) 从堆中弹出最小的元素...# heapify(heap) 让列表具备堆特征
# heapreplace(heap, x) 弹出最小的元素,并将x压入堆中
# nlargest(n, iter)...返回iter中n个最大的元素
# nsmallest(n, iter) 返回iter中n个最小的元素
nums = [8, 1, 2, 3, 7, 5, 6, 4...) # Item('ddd')
# _queue=[],_index=4
from collections import defaultdict
# defaultdict是Python