Exemple #1
0
        //public V Find(string Key)
        //{
        //    int hash = FoldHash(Key);
        //    int index = hash % _count;
        //    V result = _arr[index]._items.Find(Key); //NOT FINISH TODO
        //    return result;
        //}
        public void Insert(string Key, V Value)
        {
            HashTableNodePair <string, V> KVPair = new HashTableNodePair <string, V>();

            KVPair.Key   = Key;
            KVPair.Value = Value;

            int hash  = FoldHash(Key);
            int index = hash % _count;

            checkFillFactor();

            _arr[index].Add(KVPair);
            _members++;
        }
Exemple #2
0
 public void Add(HashTableNodePair <TKey, TValue> KVPair)
 {
     _items.AddLast(KVPair);
 }