MCPcopy Index your code
hub / github.com/neetcode-gh/leetcode / get

Method get

java/0460-lfu-cache.java:23–28  ·  view source on GitHub ↗
(int key)

Source from the content-addressed store, hash-verified

21 }
22
23 public int get(int key) {
24 Entry e = entries.get(key);
25 if (e == null) return -1;
26 updateFrequency(e);
27 return e.value;
28 }
29
30 public void put(int key, int value) {
31 if (capacity == 0) return;

Callers 15

LockingTreeMethod · 0.45
backtrackMethod · 0.45
deleteAndEarnMethod · 0.45
isValidMethod · 0.45
dfsMethod · 0.45
checkSubarraySumMethod · 0.45
dfsMethod · 0.45
canFinishMethod · 0.45
isCyclicMethod · 0.45
dfsMethod · 0.45
dfsMethod · 0.45

Calls 1

updateFrequencyMethod · 0.95

Tested by 1