Adding code to perform pre-order, -in-order, and post-order traversals.