# leetcode之Maximum Depth of Binary Tree

# Definition for a binary tree node.
# class TreeNode(object):
#     def __init__(self, x):
#         self.val = x
#         self.left = None
#         self.right = None

class Solution(object):
def maxDepth(self, root):
"""
:type root: TreeNode
:rtype: int
"""
depth = 0
if root == None:
return 0
else:
return 1 + depth + max(self.maxDepth(root.right), self.maxDepth(root.left))

#### leetcode 104 Maximum Depth of Binary Tree二叉树求深度

2015-05-13 22:16:12

#### Maximum Depth of Binary Tree -- LeetCode

2014-02-22 03:34:51

#### 104. Maximum Depth of Binary Tree [easy] (Python)

2016-05-07 13:21:08

#### maximum-depth-of-binary-tree(二叉树的最大深度)

2016-09-07 20:55:45

#### 【LeetCode-面试算法经典-Java实现】【104-Maximum Depth of Binary Tree（二叉树的最大深度）】

2015-08-08 06:43:32

#### 【LeetCode】【Python题解】Single Number & Maximum Depth of Binary Tree

2014-07-20 13:18:24

#### LeetCode#104. 二叉树的最大深度

2018-07-02 15:31:24

#### LeetCode104——Maximum Depth of Binary Tree

2015-02-05 15:29:44

#### Given a binary tree, find its maximum depth.

2014-05-23 14:21:31

#### 104. Maximum Depth of Binary Tree的C++解法

2017-03-30 13:31:29
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://blog.csdn.net/howtogetout/article/details/49950999", "fetch_time": 1531758652000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2018-30/segments/1531676589404.50/warc/CC-MAIN-20180716154548-20180716174548-00358.warc.gz", "warc_record_offset": 631483363, "warc_record_length": 11149, "token_count": 405, "char_count": 1152, "score": 3.5625, "int_score": 4, "crawl": "CC-MAIN-2018-30", "snapshot_type": "latest", "language": "en", "language_score": 0.2999698519706726, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00060-of-00064.parquet"}