package traverse; public class Main { public static void main(String[] args) { BTree sample = new BTree( new BNode("A", new BNode("B", new BNode("D"), new BNode("E", null, new BNode("H", new BNode("J"), null))), new BNode("C", new BNode("F"), new BNode("G", null, new BNode("I"))))); System.out.println(""); System.out.println("A sample binary tree"); System.out.println("--------------------"); System.out.println(""); System.out.print("* printed using a stack-based traversal:\n\n\t"); sample.print(new StackAsStruc>()); System.out.println("\n"); System.out.print("* printed using a queue-based traversal:\n\n\t"); sample.print(new QueueAsStruc>()); System.out.println("\n"); } }