public void AddNode(Node node) { // add the node to the base list Nodes.Add(node); // add the node to the parent's childs list node.Parent.Childs.Add(node); AddBuffer.Enqueue(node); }
public void AddNode(Node node) { // add the node to the base list Nodes.Add(node); // if the current node does not have child, it is the last node in the path if (node.Child == null) { Last = node; } AddBuffer.Enqueue(node); }
public Tree(Node root, int maxSize, TreeBehaviour mode = TreeBehaviour.Cyclic) { MaxSize = maxSize; Nodes.Add(root); Root = root; AddBuffer.Enqueue(root); Model = new TreeModel(this); Mode = mode; }