Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

tree algorithm example

public class Tree<T> {
    private Node<T> root;

    public Tree(T rootData) {
        root = new Node<T>();
        root.data = rootData;
        root.children = new ArrayList<Node<T>>();
    }

    public static class Node<T> {
        private T data;
        private Node<T> parent;
        private List<Node<T>> children;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #tree #algorithm
ADD COMMENT
Topic
Name
6+1 =