Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2870c6d

Browse files
author
jsquared21
committed
Edit method MyHashMap.remove(key)
1 parent003eec0 commit2870c6d

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
intindex =hash(key.hashCode());
162162
intj =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)

[8]ページ先頭

©2009-2025 Movatter.jp