|
@SeaTac #39 你可能记错了, LinkedHashMap 才是 LRU 实现啊, 这是这个类的文档:
This implementation differs from HashMap in that it maintains a doubly-linked list running through all of its entries. This linked list defines the encounter order (the order of iteration), which is normally the order in which keys were inserted into the map (insertion-order). The least recently inserted entry (the eldest) is first, and the youngest entry is last.
不够 LFU 确实麻烦点, 适合口述实现思路, 自己写我没把握一次写对. |