Merge pull request #1 from TheMessik/graph

Graph
binarytree
jjankaj 2021-05-02 19:51:32 +02:00 committed by GitHub
commit e29bbcbb89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,11 @@
package graph;
import java.util.List;
public abstract class Graph {
protected List<Node> nodes;
public List<Node> getAllNodes() {
return nodes;
}
}

View File

@ -0,0 +1,20 @@
package graph;
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;
}
}