20 lines
329 B
Java
20 lines
329 B
Java
|
public class Tree<T> {
|
||
|
private Node rootNode;
|
||
|
|
||
|
public Tree() {
|
||
|
rootNode = new Node(null);
|
||
|
}
|
||
|
|
||
|
public void setRootNode(Node rootNode) {
|
||
|
this.rootNode = rootNode;
|
||
|
}
|
||
|
|
||
|
public Node getRootNode() {
|
||
|
return rootNode;
|
||
|
}
|
||
|
|
||
|
public void showTree() {
|
||
|
rootNode.showNode();
|
||
|
}
|
||
|
}
|