Java 에서 Tree 구현을 위한 class

This topic contains 0 replies, has 1 voice, and was last updated by  technote 2017-10-17 18:45.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #78

    technote
    Keymaster

    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; } }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.