【发布时间】:2020-05-04 15:54:20
【问题描述】:
我的优先级队列定义为
PriorityQueue< LRUCache > qu = new PriorityQueue<>(new Comp() );
这里的 LRUCache 类有变量 key 和 freq,我基于它创建了 Comparator。 如果我必须根据某些键和频率从优先级队列中删除特定对象 我该怎么做呢
qu.remove(new LRUCache(key , freq ) ) // like this or something better ??
【问题讨论】:
标签: java dictionary queue heap priority-queue