Skip to content

Commit af82df0

Browse files
author
Joseph Luce
authored
Update 145_binary_tree_postorder_traversal.md
1 parent 829cdff commit af82df0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

leetcode/hard/145_binary_tree_postorder_traversal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class Solution:
3131

3232
The iterative solution for post order is fairly diffucult to come up with on your own.
3333
It requires two stacks.
34-
The first stack is used to traverse the tree but in the opposite direction, going to the right side first then visiting the left nodes.
35-
During the traversal, the 1st stack will transfer its nodes to the 2nd stack, this will place the nodes in the reverse order or post-order when they are popped off the stack later.
34+
The first stack is used to traverse the tree but in the opposite direction (node -> right -> left).
35+
During the traversal, the 1st stack will transfer its nodes to the 2nd stack, this will place the nodes in the reverse order or post-order (left -> right -> node) when they are popped off the stack later.
3636
I recommend drawing this out, as its important to understand the relationships and responsibilities.
3737

3838
```

0 commit comments

Comments
 (0)