So I been working on this TreeNode program and I couldn't figure out how to print the PostOrder and PreOrder. I got the inOrder correct, but couldn't figure out the rest of the code for PreOrder and PostOrder.
Here my code for inOrder for TreeNode:
public static <T> void inOrder(TNode<T> node) {
if (node.getLeft() != null)
inOrder(node.getLeft());
System.out.print(node.getData() + " ");
if (node.getRight() != null)
inOrder(node.getRight());
}