import java.util.*; /** A set of nodes */ public class Graph { /** Map a node name to the node */ ... define nodes field here ... public Node addNode(String name) { } public void addEdge(String name, String target) { } /** Return sorted list of all nodes between start and stop, inclusively */ public List getAllNodes(String start, String stop) { Set pathNodes = new HashSet(); _getAllNodes(nodes.get(start), nodes.get(stop), pathNodes); List nodeList = new ArrayList(pathNodes); Collections.sort(nodeList); return nodeList; } protected boolean _getAllNodes(Node p, Node stop, Set pathNodes) { } public int getMinPathLength(String start, String stop) { } /** Return a sorted list of all nodes reachable from start, inclusively */ public List getAllReachableNodes(String start) { } public List getRootNames() { } /** Print out an edge list for graph */ public String toString() { } }