I am a software development engineer @ Amazon AWS. I graduated from UPenn and Brandeis. I hope everyone stay strong and stay healthy in these challenging times.
traversal
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 { |