LRU hashMap(拉链) + 双向链表 java实现
//基于 hash (拉链法) + 双向链表,LRUcache //若改为开放寻址,线性探测法能更好使用cpuCache public class LRU { private class Node { Node p; //访问序 priv Node n; //访问序 next Node hn; //hash 拉链 next Object key; Object val; public Node() { } public Node(Object key, Object val) { this.key = key; this.val = val; } @Override public String toString() { return "Node{" + "key=" + key + ", val=" + val + ", hn=" + (hn == null ? "n" : hn.key) + ", p=" + (p == null ? "n" : p.key) + ", n=" + (n == null ? "n" : n.key) + '}'; } } Node head; Node tail; Node[] tables; int capa = 4; int tabSize; //2的整数倍 int count; int countLimit = 8; float