Represent null with INT_MAX in C, C++.

This commit is contained in:
krahets
2023-04-18 14:31:23 +08:00
parent ed8fa6aea3
commit 6723cdbc7e
11 changed files with 35 additions and 26 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ int height(TreeNode *node) {
}
/* 更新节点高度 */
int updateHeight(TreeNode *node) {
void updateHeight(TreeNode *node) {
int lh = height(node->left);
int rh = height(node->right);
// 节点高度等于最高子树高度 + 1