// Short program that demonstrates the use of the IntTree class.

public class IntTreeClient {
    public static void main(String[] args) {
        // IntTree t = new IntTree(12);
        
        // Reference tree #2
        IntTreeNode root = new IntTreeNode(2,
            new IntTreeNode(8,
                new IntTreeNode(0)
            ),
            new IntTreeNode(1,
                new IntTreeNode(7,
                    new IntTreeNode(4)
                ),
                new IntTreeNode(6,
                    null,
                    new IntTreeNode(9)
                )
            )
        );
        IntTree t = new IntTree(root);
        
        System.out.println("Before: tree structure:");
        t.printSideways();
        
        t.flipOutOfOrder();

        System.out.println("After: tree structure:");
        t.printSideways();
        
        
        /*
        System.out.println("Tree structure:");
        t.printSideways();
        System.out.println();
        t.printPreorder();
        t.printInorder();
        t.printPostorder();
        */
        // t.printIndented();
    }
}
