Tree: Height of a Binary Tree

  • + 0 comments

    Java Solution public static int height(Node root) { // Write your code here.

          if(*root == null)
          return -1;
    
          int left = height(root.left);
          int right = height(root.right);
    
    
          return 1+Math.max(left, right);
    }