function TreeDepth(pRoot) { // write code here if(pRoot == null){ return 0; } var left = TreeDepth(pRoot.left); var right = TreeDepth(pRoot.right); return Math.max(left,right)+1; }
function TreeDepth(pRoot) { // write code here if(pRoot == null){ return 0; } var left = TreeDepth(pRoot.left); var right = TreeDepth(pRoot.right); return Math.max(left,right)+1; }