mirror of https://github.com/TheMessik/TreeLib
backbone should be done
parent
b39780a2f5
commit
e92c291e57
|
@ -1,6 +0,0 @@
|
|||
package graph;
|
||||
|
||||
public class Edge<T> {
|
||||
Node<T> node1;
|
||||
Node<T> node2;
|
||||
}
|
|
@ -1,4 +1,11 @@
|
|||
package graph;
|
||||
|
||||
public class Graph {
|
||||
import java.util.List;
|
||||
|
||||
public abstract class Graph {
|
||||
protected List<Node> nodes;
|
||||
|
||||
public List<Node> getAllNodes() {
|
||||
return nodes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
package graph;
|
||||
|
||||
public class Node<T> {
|
||||
T item;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class Node {
|
||||
private final String item;
|
||||
private List<Node> children;
|
||||
|
||||
public Node(String item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public List<Node> getChildren() {
|
||||
return children;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue