This commit is contained in:
krahets
2023-05-04 05:22:28 +08:00
parent dfa5ebdffa
commit 9b5450e380
5 changed files with 343 additions and 11 deletions
+1 -1
View File
@@ -1960,7 +1960,7 @@ AVL 树的特点在于「旋转 Rotation」操作,它能够在不影响二叉
}
} else {
// 子节点数量 = 2 ,则将中序遍历的下个节点删除,并用该节点替换当前节点
let temp = node?.right
var temp = node?.right
while temp?.left != nil {
temp = temp?.left
}
+1 -1
View File
@@ -1087,7 +1087,7 @@ comments: true
// 子节点数量 = 2
else {
// 获取中序遍历中 cur 的下一个节点
let tmp = cur?.right
var tmp = cur?.right
while tmp?.left != nil {
tmp = tmp?.left
}