Example #1
0
        //добавление
        public void Add(int key, T value)
        {
            Remove(key);

            HashTableNode <T> newNode = new HashTableNode <T>(key, value);
            int index = CalcHash(key);

            _table[index].Add(newNode);
            Count++;
        }
Example #2
0
        public void Add(int key, TValue value)
        {
            if (_count >= _table.Length * 0.75)
            {
                Resize();
            }

            HashTableNode <TValue> nHash = new HashTableNode <TValue>(key, value);
            int index = FullGetIndexByKey(key);

            _table[index] = nHash;

            _count++;
        }