You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: leetcode/hard/145_binary_tree_postorder_traversal.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ class Solution:
32
32
The iterative solution for post order is fairly diffucult to come up with on your own.
33
33
It requires two stacks.
34
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 2nd stackwill place the nodes in the reverse order or post-order when they are popped off the stack.
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.
36
36
I recommend drawing this out, as its important to understand the relationships and responsibilities.
0 commit comments