Skip to content

Commit 683a5d3

Browse files
author
Joseph Luce
authored
Update 538_convert_BST_to_greater_tree.md
1 parent 03ae883 commit 683a5d3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

leetcode/easy/538_convert_BST_to_greater_tree.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Recursive Solution
22
- Runtime: O(N)
3-
- Space: O(N)
4-
- N = Number of nodes in BST
3+
- Space: O(H)
4+
- N = Number of elements in tree
5+
- H = Height of Tree
56

67
Take for example this BST:
78
```
@@ -45,8 +46,9 @@ class Solution:
4546

4647
## Iterative Solution
4748
- Runtime: O(N)
48-
- Space: O(N)
49-
- N = Number of nodes in BST
49+
- Space: O(H)
50+
- N = Number of elements in tree
51+
- H = Height of Tree
5052

5153
```
5254
class Solution:

0 commit comments

Comments
 (0)