MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / hash

Method hash

java/0706-design-hashmap.java:17–19  ·  view source on GitHub ↗
(int key)

Source from the content-addressed store, hash-verified

15 this.data = new ListNode[size];
16 }
17 private int hash(int key) {
18 return (int)((long)key * mult % size);
19 }
20 public void put(int key, int val) {
21 remove(key);
22 int h = hash(key);

Callers 3

putMethod · 0.95
getMethod · 0.95
removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected