mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-07 11:36:46 +08:00
build
This commit is contained in:
@@ -1357,7 +1357,7 @@ comments: true
|
||||
```c title="binary_search_tree.c"
|
||||
/* 删除节点 */
|
||||
// 由于引入了 stdio.h ,此处无法使用 remove 关键词
|
||||
void removeNode(binarySearchTree *bst, int num) {
|
||||
void removeItem(binarySearchTree *bst, int num) {
|
||||
// 若树为空,直接提前返回
|
||||
if (bst->root == NULL)
|
||||
return;
|
||||
@@ -1399,7 +1399,7 @@ comments: true
|
||||
}
|
||||
int tmpVal = tmp->val;
|
||||
// 递归删除节点 tmp
|
||||
removeNode(bst, tmp->val);
|
||||
removeItem(bst, tmp->val);
|
||||
// 用 tmp 覆盖 cur
|
||||
cur->val = tmpVal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user