Created
January 5, 2017 01:47
-
-
Save liondancer/203468566aaf8c2ae2d0170a1c5e27d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def maxDepth(root): | |
""" | |
:type root: TreeNode | |
:rtype: int | |
""" | |
if root is None: | |
return 0 | |
return max(maxDepth(root.left), maxDepth(root.right)) + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment