third commit

This commit is contained in:
hong skkusosc 2018-05-27 21:37:01 +09:00
parent 866903fe84
commit 5e9e829bb3

View File

@ -19,19 +19,19 @@ public class TreeTraversal {
tree.insert(8); tree.insert(8);
// Prints 5 3 2 4 7 6 8 // Prints 5 3 2 4 7 6 8
System.out.println("Pre order traversal:"); System.out.println("Preorder traversal:");
tree.printPreOrder(); tree.printPreOrder();
System.out.println(); System.out.println();
// Prints 2 3 4 5 6 7 8 // Prints 2 3 4 5 6 7 8
System.out.println("In order traversal:"); System.out.println("Inorder traversal:");
tree.printInOrder(); tree.printInOrder();
System.out.println(); System.out.println();
// Prints 2 4 3 6 8 7 5 // Prints 2 4 3 6 8 7 5
System.out.println("Post order traversal:"); System.out.println("Postorder traversal:");
tree.printPostOrder(); tree.printPostOrder();
System.out.println(); System.out.println();
// Prints 5 3 7 2 4 6 8 // Prints 5 3 7 2 4 6 8
System.out.println("Level order traversal:"); System.out.println("Levelorder traversal:");
tree.printLevelOrder(); tree.printLevelOrder();
System.out.println(); System.out.println();
} }