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