mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-21 07:47:14 +00:00
Represent null with INT_MAX in C, C++.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user