//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Solution to Quiz 4: Binary Search Tree Traversals //Description: Perform the three different kinds of traversals on a given BST. //CS 284 //Programmed by Jonathan Voris //3/29/06 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public class quiz4solution { public static void main(String[] args) { Integer[] quizValues = {22, 7, 54, 19, 30, 61, 10}; BinaryTree quizTree = new BinaryTree(quizValues); System.out.println("1) Postorder traversal: " + quizTree.postorder()); System.out.println("2) Preorder traversal: " + quizTree.preorder()); System.out.println("3) Inorder traversal: " + quizTree.inorder()); } }