mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 06:56:06 +00:00
Update a comment in binary_search_tree.
This commit is contained in:
@@ -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 的左子树中
|
||||
}
|
||||
}
|
||||
// 若无待删除结点,则直接返回
|
||||
|
||||
Reference in New Issue
Block a user