【Leetcode】559. Maximum Depth of N-ary Tree

求N-叉树的最大深度 方法1 有helper函数的递归 要注意递归停止的条件不是root==None,而是root 没有孩子 class Solution1(object): def maxDepth(self, root): """ :type root: Node :rtype: int """ if root == None:
相关文章
相关标签/搜索