The reference sheet below shows the print traversal order for preorder, inorder, postorder and levelorder tree traversal.
Code for printing preorder, inorder, postorder and levelorder traversal is available here. Instructions for inputting a graph can be found in this tutorial.
Both recursive and iterative algorithms for tree traversal are available here.
Tree Input:

Tree Traversal Reference Sheet:
