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

Method find

java/706_Design_HashMap.java:32–39  ·  view source on GitHub ↗
(ListNode bucket, int key)

Source from the content-addressed store, hash-verified

30 int idx(int key) { return Integer.hashCode(key) % nodes.length;}
31
32 ListNode find(ListNode bucket, int key) {
33 ListNode node = bucket, prev = null;
34 while (node != null && node.key != key) {
35 prev = node;
36 node = node.next;
37 }
38 return prev;
39 }
40
41 class ListNode {
42 int key, val;

Callers 3

putMethod · 0.95
getMethod · 0.95
removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected