public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Node root = new Node();// A1 root.setName("A1"); root.addChild("B1"); root.addChild("B2"); root.addChild("B3"); root.getNode("B1").addChild("C1"); root.getNode("B1").addChild("C2",8); root.getNode("B2").addChild("C3"); root.getNode("B2").addChild("C4"); root.getNode("B2").addChild("C5"); root.getNode("B3").addChild("C6",9); root.getNode("B3").addChild("C7"); root.getNode("B1").getNode("C1").addChild("D1",10); root.getNode("B1").getNode("C1").addChild("D2",12); root.getNode("B2").getNode("C3").addChild("D3"); root.getNode("B2").getNode("C3").addChild("D4"); root.getNode("B2").getNode("C4").addChild("D5"); root.getNode("B2").getNode("C5").addChild("D6",11); root.getNode("B2").getNode("C5").addChild("D7"); root.getNode("B3").getNode("C7").addChild("D8",7); root.getNode("B3").getNode("C7").addChild("D9"); root.getNode("B2").getNode("C3").getNode("D3").addChild("E1",7); root.getNode("B2").getNode("C3").getNode("D3").addChild("E2",9); root.getNode("B2").getNode("C3").getNode("D4").addChild("E3",10); root.getNode("B2").getNode("C3").getNode("D4").addChild("E4",11); root.getNode("B2").getNode("C4").getNode("D5").addChild("E5",8); root.getNode("B2").getNode("C4").getNode("D5").addChild("E6",6); root.getNode("B2").getNode("C4").getNode("D5").addChild("E7",5); root.getNode("B2").getNode("C5").getNode("D7").addChild("E8",9); root.getNode("B2").getNode("C5").getNode("D7").addChild("E9",6); root.getNode("B2").getNode("C5").getNode("D7").addChild("E10",8); root.getNode("B3").getNode("C7").getNode("D9").addChild("E11",8); root.getNode("B3").getNode("C7").getNode("D9").addChild("E12",10); int max = root.getValue(-1,100); System.out.println("\nExpansions completed\n"); System.out.println("Value of Max Node A1="+max); System.out.println("Node A1 passed times="+root.traveltimes); System.out.println("Move that Max Node A would make is "+root.movetiems); ; } }