Question: Revise Listing 29.9, WeightedNineTail.java, for the weighted 4 * 4 16 tails problem. Your program should read the model object created from the preceding exercise.
Revise Listing 29.9, WeightedNineTail.java, for the weighted 4 * 4 16 tails problem. Your program should read the model object created from the preceding exercise.
Data from Listing 29.9,


1mport java.util.: 3 publ1c class WeightedNineTail Model extends NineTail Model { " Construct a model / pub11c WeightedNineTailModel (O { T Create edges List edges = getEdges (): 4 7 8 II Create a graph WeightedGraph < Integer> graph = new WeightedGraph ( edges, NUMBER_OF_NODES): 9 10 11 12 II Obtain a shortest-path tree rooted at the target node tree = graph.getShortestPath(511): 13 14 15 16 |" Create al1 edges for the graph / private List getEdges () { II Store edges List edges = new ArrayList (: 17 18 19 20 123 t56
Step by Step Solution
3.51 Rating (168 Votes )
There are 3 Steps involved in it
import javaioFileInputStream import javaioObjectInputStream import javautilScanner Note initialize p... View full answer
Get step-by-step solutions from verified subject matter experts
