MCPcopy Create free account
hub / github.com/codedecks-in/LeetCode-Solutions / LRUCache

Method LRUCache

Java/LRU-Cache.java:16–21  ·  view source on GitHub ↗
(int capacity)

Source from the content-addressed store, hash-verified

14 Map<Integer, Node> map;
15
16 public LRUCache(int capacity) {
17 map = new HashMap(capacity);
18 this.capacity = capacity;
19 head.next = tail;
20 tail.prev = head;
21 }
22
23 public int get(int key) {
24 int result = -1;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected