Implement preorder and postorder in terms of DFS
preorder and postorder can take a list of roots