摘要: 头条算法一面,记录一下 实现优先级队列(小根堆) 1 class prioQueue: 2 def __init__(self, elist=[]): 3 self._elems = list(elist) 4 if elist: 5 self.buildheap() 6 def siftdown( 阅读全文
posted @ 2020-01-02 20:01 Assange 阅读(342) 评论(0) 推荐(0) 编辑