mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-11-13 17:41:47 +00:00
Update 算法 - 符号表.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
97ed6381d7
commit
3986b77ef4
+3
-1
@@ -127,8 +127,10 @@ public class ListUnorderedST<Key, Value> implements UnorderedST<Key, Value> {
|
|||||||
public void delete(Key key) {
|
public void delete(Key key) {
|
||||||
if (first == null)
|
if (first == null)
|
||||||
return;
|
return;
|
||||||
if (first.key.equals(key))
|
if (first.key.equals(key)) {
|
||||||
first = first.next;
|
first = first.next;
|
||||||
|
return;
|
||||||
|
}
|
||||||
Node pre = first, cur = first.next;
|
Node pre = first, cur = first.next;
|
||||||
while (cur != null) {
|
while (cur != null) {
|
||||||
if (cur.key.equals(key)) {
|
if (cur.key.equals(key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user