Skip to content

Commit a23d126

Browse files
author
Joseph Luce
authored
Update 145_binary_tree_postorder_traversal.md
1 parent 1f8d8ed commit a23d126

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

leetcode/hard/145_binary_tree_postorder_traversal.md

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

33
## Recursive Solution
44
- Runtime: O(N)
5-
- Space: O(N)
6-
- N = Number of nodes in tree
5+
- Space: O(H)
6+
- N = Number of elements in tree
7+
- H = Height of tree
78

89
Post order is left, right, node.
910

@@ -26,8 +27,9 @@ class Solution:
2627

2728
## Iterative Solution
2829
- Runtime: O(N)
29-
- Space: O(N)
30-
- N = Number of nodes in tree
30+
- Space: O(H)
31+
- N = Number of elements in tree
32+
- H = Height of tree
3133

3234
The iterative solution for post order is fairly diffucult to come up with on your own.
3335
It requires two stacks.

0 commit comments

Comments
 (0)