dfs pre order traversal binary tree algorithm