首页 > 代码库 > 二叉树的深度

二叉树的深度

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

 

二叉树的深度