tree pre-order traversal