Update a comment in binary_search_tree.

This commit is contained in:
Yudong Jin
2023-01-15 15:43:06 +08:00
parent 33e84ff50b
commit 3e19205c84
7 changed files with 24 additions and 24 deletions
@@ -97,9 +97,9 @@ function remove(num: number): TreeNode | null {
}
pre = cur;
if (cur.val < num) {
cur = cur.right as TreeNode; // 待删除结点在 root 的右子树中
cur = cur.right as TreeNode; // 待删除结点在 cur 的右子树中
} else {
cur = cur.left as TreeNode; // 待删除结点在 root 的左子树中
cur = cur.left as TreeNode; // 待删除结点在 cur 的左子树中
}
}
// 若无待删除结点,则直接返回