https://leetcode.com/problems/binary-tree-postorder-traversal/
- stack으로 dfs 도는 문제이다.
- 가장 중요한 point는 PRE, IN, POST state를 저장해야 한다는 점
- 다른 중요한 점은 stack.top()을 고칠때는 래퍼런스를 받아와봐야 소용없고 직접 고쳐야 한다는 점이다.
1 |
|
https://leetcode.com/problems/binary-tree-postorder-traversal/
1 |
|