Chewy Bucky

Greenhorn
+ Follow
since Oct 18, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chewy Bucky

/** Adds a node to this graph.
@param node the node to add
@throws IllegalArgumentException if node already exists in the graph
@throws NullPointerException if node is null*/
void addNode(Object node){

}

/** Adds an edge that joins two nodes.
@param fromNode the starting node for this edge
@param toNode the ending node for this edge
@param edge the edge to add
@throws IllegalArgumentException if edge already exists in the graph,
or if startNode or endNode do not exist.
@throws NullPointerException if edge is null
*/
void addEdge(Object fromNode, Object toNode, Object edge){

}

/** Gets the start node of a given edge.
@param edge an edge of this graph
@return the start node of this edge, or null if this edge does not
exist in the graph.
*/
Object getStartNode(Object edge){


}

/** Gets the start node of a given edge.
@param edge an edge of this graph
@return the end node of this edge, or null if this edge does not
exist in the graph.
*/
Object getEndNode(Object edge){

}

/** Gets all nodes in this graph.
@return an immutable collection of all nodes in this graph
*/
Collection getNodes(){

}

/** Gets all edges that start or end with the given node.
@param node a node of this graph
@return an immutable collection of all edges that start or end
with node. The collection should be empty if node is a node of this
graph
*/
Collection getEdges(Object node){

}

}

Stumped on figuring out what data structure to use that's simpliest to implement.
[ October 18, 2005: Message edited by: Chewy Bucky ]
18 years ago