diff --git a/Tree/MaximumDepthOfBinaryTree.swift b/Tree/MaximumDepthOfBinaryTree.swift index c85f713..20f48f1 100644 --- a/Tree/MaximumDepthOfBinaryTree.swift +++ b/Tree/MaximumDepthOfBinaryTree.swift @@ -1,7 +1,7 @@ /** * Question Link: https://leetcode.com/problems/maximum-depth-of-binary-tree/ * Primary idea: recursion, return 0 when it is a leaf node - * Time Complexity: O(n), Space Complexity: O(1) + * Time Complexity: O(n), Space Complexity: O(n) * * Definition for a binary tree node. * public class TreeNode { @@ -24,4 +24,4 @@ class MaximumDepthOfBinaryTree { return max(maxDepth(root.left), maxDepth(root.right)) + 1 } -} \ No newline at end of file +} diff --git a/Untitled Diagram.drawio b/Untitled Diagram.drawio new file mode 100644 index 0000000..8be4b73 --- /dev/null +++ b/Untitled Diagram.drawio @@ -0,0 +1 @@ +UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file