internal RangeTreeNode <T> Insert(T value)
        {
            var newNode = new RangeTreeNode <T>(value);

            tree.Insert(newNode);
            return(newNode);
        }
        internal RangeTreeNode <T> Insert(T value)
        {
            var newNode = new RangeTreeNode <T>(value);

            var existing = tree.FindNode(newNode);

            if (existing != null)
            {
                existing.Value.Values.Add(value);
                return(existing.Value);
            }

            tree.Insert(newNode);
            return(newNode);
        }
 //O(log(n) time complexity;
 //add an item to this hash table
 public void Add(TK key, TV value)
 {
     binarySearchTree.Insert(new TreeDictionaryNode <TK, TV>(key, value));
 }
Exemple #4
0
 //O(log(n) time complexity;
 //add an item to this hash table
 public void Add(V value)
 {
     binarySearchTree.Insert(value);
 }
 //O(log(n) time complexity;
 //add an item to this hash table
 public void Add(K key, V value)
 {
     binarySearchTree.Insert(new TreeDictionaryNode <K, V>(key, value));
 }