package abstractions; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public abstract class Tree> { protected Node root; protected List> nodes; protected Set values; public Tree() { this.nodes = new ArrayList<>(); this.values = new HashSet<>(); } public List> getAllNodes() { return nodes; } public int getSize() { return nodes.size(); } public Node getRoot() { return root; } public abstract Node addNode(T value); public abstract boolean removeNode(T value); public abstract boolean removeNode(Node n); public abstract Node findNode(T value); public abstract String toString(); }