@@ -0,0 +1,1191 @@
+package customtress;%0A%0Aclass TreeNode %7B%0A%09int data;%0A%09TreeNode left = null;%0A%09TreeNode right = null;%0A%09%0A%09TreeNode(int data) %7B%0A%09%09this.data = data;%0A%09%7D%0A%7D%0Apublic class TreeTraversals %7B%0A%09%0A%09public static TreeNode createBinaryTree() %7B%0A%09%09TreeNode root = new TreeNode(40);%0A%09%09TreeNode node20= root.left = new TreeNode(20);%0A%09%09TreeNode node60 = root.right = new TreeNode(60);%0A%09%09node20.left = new TreeNode(10);%0A%09%09node20.right = new TreeNode(30);%0A%09%09node60.left = new TreeNode(50);%0A%09%09node60.right = new TreeNode(70);%0A%09%09return root;%0A%09%7D%0A%09%0A%09public static void preOrder(TreeNode root) %7B%0A%09%09if(root != null) %7B%0A%09%09%09System.out.print(root.data + %22 %22);%0A%09%09%09preOrder(root.left);%0A%09%09%09preOrder(root.right);%0A%09%09%7D%0A%09%7D%0A%0A%09public static void inOrder(TreeNode root) %7B%0A%09%09if(root != null) %7B%0A%09%09%09inOrder(root.left);%0A%09%09%09System.out.print(root.data + %22 %22);%0A%09%09%09inOrder(root.right);%0A%09%09%7D%0A%09%7D%0A%0A%09public static void postOrder(TreeNode root) %7B%0A%09%09if (root != null) %7B%0A%09%09%09postOrder(root.left);%0A%09%09%09postOrder(root.right);%0A%09%09%09System.out.print(root.data + %22 %22);%0A%09%09%7D%0A%09%7D%0A%09public static void main(String%5B%5D args) %7B%0A%09%09TreeNode tree = createBinaryTree();%0A%09%09preOrder(tree);%0A%09%09System.out.println();%0A%09%09postOrder(tree);%0A%09%09System.out.println();%0A%09%09inOrder(tree);%0A%09%7D%0A%0A%7D%0A

Create TreeTraversals.java