int height(Node *root) {
          if (root == NULL) {
              return 0;
          }
          int lheight = height(root->left);
          int rheight = height(root->right);
          return 1 + max(lheight, rheight);
      }
      

      Cpp language logo
      Height of tree

      height
      tree

      Height of tree

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.