二叉树深度 dp思想求解,若当前结点非空,则该树的深度为1加左右子树更大的那一支深度,否则返回0。 treeDepth={1+max(leftDepth,rightDepth),Tree≠NULL0,elsetreeDepth={1+max(leftDepth,rightDepth),Tree≠NULL0,else 附code: