Skip to content

Commit 5619146

Browse files
authored
Update Maximum Depth of Binary Tree - Leetcode 104.py
1 parent 4d8b09d commit 5619146

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Maximum Depth of Binary Tree - Leetcode 104.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ def maxDepth(self, root: Optional[TreeNode]) -> int:
77
right = self.maxDepth(root.right)
88

99
return 1 + max(left, right)
10+
11+
# Time Complexity: O(n)
12+
# Space Complexity: O(h) { here "h" is the height of the binary tree }

0 commit comments

Comments
 (0)