/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package trees; /** * * @author kvaradar */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Position el, rd, sales, purchasing, manufacturing, tv, cd; Position dom,intl,canada,overseas; // Creating a portion of figure 7.2 of textbook as a tree MyTree testTree = new MyTree(); el = testTree.addRoot("Eletronics R Us"); rd = testTree.addChild(el, "R and D"); sales = testTree.addChild(el, "Sales"); purchasing = testTree.addChild(el, "Purchasing"); manufacturing = testTree.addChild(el, "Manufacturing"); dom = testTree.addChild(sales, "Domestic"); intl = testTree.addChild(sales, "International"); canada = testTree.addChild(intl, "Canada"); overseas = testTree.addChild(intl, "Overseas"); tv = testTree.addChild(manufacturing, "TV"); cd = testTree.addChild(manufacturing, "CD"); // You can test the methods you write below System.out.println(testTree.size()); } }