mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-12 11:50:58 +00:00
fix(tree): add c codes
This commit is contained in:
@@ -201,8 +201,8 @@ TreeNode *search(avlTree *tree, int val) {
|
||||
TreeNode *cur = tree->root;
|
||||
// 循环查找,越过叶结点后跳出
|
||||
while (cur != NULL) {
|
||||
// 目标结点在 root 的右子树中
|
||||
if (cur->val < val) {
|
||||
// 目标结点在 root 的右子树中
|
||||
cur = cur->right;
|
||||
} else if (cur->val > val) {
|
||||
// 目标结点在 root 的左子树中
|
||||
|
||||
Reference in New Issue
Block a user