└── height.txt /height.txt: -------------------------------------------------------------------------------- 1 | class Node{ 2 | int data; 3 | Node left; 4 | Node right; 5 | } 6 | public static int height(Node root) { 7 | // Write your code here. 8 | int l,r; 9 | if(root==null) 10 | return -1; 11 | l=1+height(root.left); 12 | r=1+height(root.right); 13 | if(l>r) 14 | return l; 15 | else 16 | return r; 17 | } --------------------------------------------------------------------------------