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

Method get

Java/LRU-Cache.java:23–33  ·  view source on GitHub ↗
(int key)

Source from the content-addressed store, hash-verified

21 }
22
23 public int get(int key) {
24 int result = -1;
25 Node node = map.get(key);
26 if(node!=null)
27 {
28 remove(node);
29 add(node);
30 result = node.val;
31 }
32 return result;
33 }
34
35 public void put(int key, int value) {
36 Node node = map.get(key);

Callers 6

subdomainVisitsFunction · 0.45
146.LRU-Cache.jsFile · 0.45
twoSumMethod · 0.45
putMethod · 0.45
findShortestSubArrayMethod · 0.45
firstUniqCharMethod · 0.45

Calls 2

removeMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected