You are viewing a single comment's thread. Return to all 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); }
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Height of a Binary Tree
You are viewing a single comment's thread. Return to all comments →
Java Solution public static int height(Node root) { // Write your code here.