Binary Tree Traversal, Part 1
outline:
- pre-order, post-order, in-order traversal of binary tree
- level-order traversal of binary tree
pre-order, post-order, in-order traversal of binary tree
pre-order:
1 | class Solution { |
post-order:
1 | class Solution { |
in-order:
1 | class Solution { |
level-order
recursive method:
1 | class Solution { |
iterative method:
1 | class Solution { |