Skip to content

Commit 2870c6d

Browse files
author
jsquared21
committed
Edit method MyHashMap.remove(key)
1 parent 003eec0 commit 2870c6d

File tree

2 files changed

+1
-0
lines changed

2 files changed

+1
-0
lines changed
0 Bytes
Binary file not shown.

Exercise_27/Exercise_27_02/MyHashMap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public void remove(K key) {
161161
int index = hash(key.hashCode());
162162
int j = 0;
163163

164+
// Remove the first entry that matches the key
164165
while (table.get(index) != null) {
165166
if (table.get(index).getKey().equals(key)) {
166167
table.remove(index);

0 commit comments

Comments
 (0)