void Insert(RBBranch <T> node) { root.Insert(node); node.InsertRepair(); root = node; while (root.parent != null) { root = root.parent; } }
public override void Insert(RBBranch <T> newNode) { T t = newNode.value; int compareResult = t.CompareTo(value); if (compareResult == 0) { throw new ArgumentException(string.Format("Duplicate value {0} specified", t)); } else if (compareResult > 0) { right.Insert(newNode); } else { left.Insert(newNode); } }