LRU cache in Java with Generics and O(1) operations

后端 未结 14 1705
刺人心
刺人心 2020-12-02 07:12

This is a question that comes up a lot in job interviews. The idea is to define a data structure instead of using Java\'s built in LinkedHashMap.

An LRU cache delete

14条回答
  •  渐次进展
    2020-12-02 07:46

    @templatetypedef

    public LinkedHashMap(int initialCapacity,
             float loadFactor,
             boolean accessOrder)
    

    accessOrder - the ordering mode - true for access-order, false for insertion-order

提交回复
热议问题