Guest User

Tree

a guest
Feb 18th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. public class Tree {
  2.  
  3.     private Node root;
  4.  
  5.     public Tree(Node root) {
  6.         this.root = root;
  7.     }
  8.  
  9.     public Tree() {
  10.         this(null);
  11.     }
  12.  
  13.     public Node getRoot() {
  14.         return root;
  15.     }
  16.  
  17.     public void setRoot(Node root) {
  18.         this.root = root;
  19.     }
  20.  
  21.     public String toString() {
  22.         return "Tree["+root+"]";
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment