MCPcopy
hub / github.com/qiyuangong/leetcode / remove

Method remove

java/706_Design_HashMap.java:22–28  ·  view source on GitHub ↗
(int key)

Source from the content-addressed store, hash-verified

20 }
21
22 public void remove(int key) {
23 int i = idx(key);
24 if (nodes[i] == null) return;
25 ListNode prev = find(nodes[i], key);
26 if (prev.next == null) return;
27 prev.next = prev.next.next;
28 }
29
30 int idx(int key) { return Integer.hashCode(key) % nodes.length;}
31

Callers 7

minIncrementForUniqueMethod · 0.45
thirdMaxMethod · 0.45
totalFruitMethod · 0.45
floodFillMethod · 0.45
popMethod · 0.45
popMaxMethod · 0.45
backtrackingMethod · 0.45

Calls 2

idxMethod · 0.95
findMethod · 0.95

Tested by

no test coverage detected