输入一棵二叉树,判断该二叉树是不是平衡二叉树

int TreeDepth(TreeNode* pRoot) { if(!pRoot) return 0; int nLeft = TreeDepth(pRoot->left); int nRight = TreeDepth(pRoot->right); return (nLeft > nRight) ? (nLeft + 1) :
相关文章
相关标签/搜索