MCPcopy
hub / github.com/wangzheng0822/algo / get

Method get

java/18_hashtable/HashTable.java:164–177  ·  view source on GitHub ↗

获取 @param key @return

(K key)

Source from the content-addressed store, hash-verified

162 * @return
163 */
164 public V get(K key) {
165 int index = hash(key);
166 Entry<K, V> e = table[index];
167 if (e == null || e.next == null) {
168 return null;
169 }
170 while (e.next != null) {
171 e = e.next;
172 if (key == e.key) {
173 return e.value;
174 }
175 }
176 return null;
177 }
178}

Callers 5

bfsMethod · 0.45
recurDfsMethod · 0.45
insertMethod · 0.45
buildFailurePointerMethod · 0.45
matchMethod · 0.45

Calls 1

hashMethod · 0.95

Tested by

no test coverage detected