Fix some code bugs (#1021)

* fix(counting_sort.c): Fix access out-of-bounds issue

* fix(hash_map_open_addressing.c): Fix coding errors

* fix(binary_search_tree.c): Fix unreleased memory

* Update indentataion
This commit is contained in:
gonglja
2024-01-02 21:45:01 +08:00
committed by GitHub
parent ef40418129
commit 3a559f1b60
3 changed files with 5 additions and 3 deletions
@@ -117,6 +117,8 @@ void removeItem(BinarySearchTree *bst, int num) {
} else {
pre->right = child;
}
// 释放内存
free(cur);
} else {
/* 子节点数量 = 2 */
// 获取中序遍历中 cur 的下一个节点