You are viewing a single comment's thread. Return to all comments →
My recursive Java solution
static int height(Node root) { if (root == null) return -1; int left = 1 + height(root.left); int right = 1 + height(root.right); return left > right ? 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 →
My recursive Java solution