Height of tree

    0

    0

    ank1traj

    heighttree

    Height of tree

    int height(Node *root) {
        if (root == NULL) {
            return 0;
        }
        int lheight = height(root->left);
        int rheight = height(root->right);
        return 1 + max(lheight, rheight);
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.