This commit is contained in:
krahets
2023-09-15 03:34:31 +08:00
parent 33edc752c8
commit 221bec3ea3
4 changed files with 127 additions and 72 deletions

View File

@@ -972,7 +972,7 @@ comments: true
cur = cur.left;
}
// 若无待删除节点,则直接返回
if (cur == null || pre == null)
if (cur == null)
return;
// 子节点数量 = 0 or 1
if (cur.left == null || cur.right == null) {