Exemple #1
0
 /// <summary>
 /// nodocu
 /// </summary>
 /// <param name="node"></param>
 public void AddChild(Node <TNodeKey, TNodeValue> node)
 {
     if (node == this)
     {
         throw new Exception("Child and parent are the same.");
     }
     if (FirstChild != null)
     {
         FirstChild.AddNeighbour(node);
     }
     else
     {
         node.Extract();
         FirstChild     = node;
         node.Parent    = this;
         _countChildren = 1;
     }
     //System.Console.WriteLine("#" + node.GetHashCode() + " " + node.Key.ToString() + " is child of " + "#" + this.GetHashCode() + " " + this.Key);
 }