base_data_structures.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:openanalysis 作者: OpenWeavers 项目源码 文件源码
def remove(self, task):
        """
        Removes the tasks from Queue
        Currently it takes O(n) time to find , and O(log n) to remove, making it O(n)
        further improvements can be done

        :param task: task to removed from the Queue
        """
        import heapq
        for task_pair in self.heap:
            if task_pair[2] == task:
                self.heap.remove(task_pair)
                heapq.heapify(self.heap)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号