Ejemplo n.º 1
0
        public void Add(T data)
        {
            int      depth = 0;
            Node <T> node  = new Node <T>(data);

            if (root == null)
            {
                node.ID = IDGenerator.GenerateRootID();
                root    = node;
                nodes.Add(node, new KeyValuePair <int, string>(depth, "Root"));
                return;
            }

            if (!IsNodeDuplicated(root, node))
            {
                AddRecursive(depth + 1, root, node);
            }
        }