the caller can now specify whether the nodes should be printed in pre-order or post-order, and whether the output should be indented.