📜  二叉树的高度 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:17.178000             🧑  作者: Mango

代码示例3
int height(Node* root) {
        // Base Condition : if root is already null. then height must be -1 to make balance with recursion call...
        if(!root) return 0;
        
        // Actual Return statement.. for recursion call..
        return 1 + max(height(root->left), height(root->right));
    }