Adding in change to Edge Node to GraphNode and making a GraphNode interface to the Node class, as we don't need the other memebers of Generic Node for a Graph Node in this case
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
public class Edge {
|
||||
Node source;
|
||||
Node destination;
|
||||
GraphNode source;
|
||||
GraphNode destination;
|
||||
int weight;
|
||||
|
||||
public Edge(Node source, Node destination, int weight) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
interface GraphNode {
|
||||
String name = "";
|
||||
List<Edge> edges = new ArrayList<Edge>();
|
||||
String getName();
|
||||
}
|
||||
|
||||
public class Node implements GraphNode {
|
||||
|
||||
Reference in New Issue
Block a user