Пример #1
0
        public void Add(T value)
        {
            if (root_ == null)
            {
                root_ = new RandomizedBinarySearchTree <T> .Node(value);
            }
            else
            {
                if (bst_.Find(root_, value) != null && isMulti_ == false)
                {
                    return;
                }

                root_ = bst_.Insert(root_, value);
            }
        }
Пример #2
0
 public void Clear()
 {
     root_ = null;
 }
Пример #3
0
 public void RemoveAt(int index)
 {
     root_ = bst_.RemoveAt(root_, index);
 }
Пример #4
0
 public void Remove(T value)
 {
     root_ = bst_.Remove(root_, value);
 }
Пример #5
0
 public OrderedSet(IComparer <T> comparer, bool isMulti = false, T inf = default(T))
 {
     inf_     = inf;
     isMulti_ = isMulti;
     bst_     = new RandomizedBinarySearchTree <T>(comparer, inf);
 }