📜  树的高度 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:54.464000             🧑  作者: 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));
    }