輸入一棵二叉樹,判斷該二叉樹是不是平衡二叉樹

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