Skip to content

Commit 03ae883

Browse files
author
Joseph Luce
authored
Update 543_diameter_of_binary_tree.md
1 parent 604444e commit 03ae883

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

leetcode/easy/543_diameter_of_binary_tree.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
## Best Solution
44
- Runtime: O(N)
5-
- Space: O(N)
6-
- N = Number of nodes in binary tree
5+
- Space: O(D)
6+
- N = Number of elements in tree
7+
- D = Depth of Tree
78

89
Take this binary tree example:
910
```
@@ -46,7 +47,3 @@ class Solution:
4647
# Follow-up Question
4748
Return instead the values of the nodes that are the longest.
4849
With the above example, return a list containing [4,2,1,3] and [5,2,1,3].
49-
50-
```
51-
52-
```

0 commit comments

Comments
 (0)