mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
Update the comments in
binary_search_tree and avl_tree.
This commit is contained in:
@ -193,10 +193,10 @@ namespace hello_algo.chapter_tree
|
||||
// 循环查找,越过叶结点后跳出
|
||||
while (cur != null)
|
||||
{
|
||||
// 目标结点在 root 的右子树中
|
||||
// 目标结点在 cur 的右子树中
|
||||
if (cur.val < val)
|
||||
cur = cur.right;
|
||||
// 目标结点在 root 的左子树中
|
||||
// 目标结点在 cur 的左子树中
|
||||
else if (cur.val > val)
|
||||
cur = cur.left;
|
||||
// 找到目标结点,跳出循环
|
||||
|
Reference in New Issue
Block a user