第26956题
有关如下Python代码的不正确说法是?
def getDepth(root):
    if root is None:
        return 0
    left_depth = getDepth(root.left)
    right_depth = getDepth(root.right)
    if left_depth < right_depth:
        return right_depth + 1
    else:
        return left_depth + 1
A

该代码可用于求解二叉树的深度

B

代码中函数 getDepth( ) 的参数 root 表示根节点,非根节点不可以作为参数

C

代码中函数 getDepth( ) 采用了递归方法

D

代码中函数 getDepth( ) 可用于求解各种形式的二叉树深度,要求该二叉树节点至少有 left 和 right 属性