mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
Update a comment in binary_search_tree.
This commit is contained in:
@ -80,9 +80,9 @@ function remove(num) {
|
||||
// 找到待删除结点,跳出循环
|
||||
if (cur.val === num) break;
|
||||
pre = cur;
|
||||
// 待删除结点在 root 的右子树中
|
||||
// 待删除结点在 cur 的右子树中
|
||||
if (cur.val < num) cur = cur.right;
|
||||
// 待删除结点在 root 的左子树中
|
||||
// 待删除结点在 cur 的左子树中
|
||||
else cur = cur.left;
|
||||
}
|
||||
// 若无待删除结点,则直接返回
|
||||
|
Reference in New Issue
Block a user