diff --git a/notes/算法 - 符号表.md b/notes/算法 - 符号表.md index bae9ad51..79fc8bb6 100644 --- a/notes/算法 - 符号表.md +++ b/notes/算法 - 符号表.md @@ -127,8 +127,10 @@ public class ListUnorderedST implements UnorderedST { public void delete(Key key) { if (first == null) return; - if (first.key.equals(key)) + if (first.key.equals(key)) { first = first.next; + return; + } Node pre = first, cur = first.next; while (cur != null) { if (cur.key.equals(key)) {