Pre order and post order tree traversal