示例#1
0
 public ZipperHashTableST(int M)
 {
     HASH_SIZE = M;
     _arraySTs = new ArrayST <TKey, TValue> [M];
     for (int i = 0; i < _arraySTs.Length; i++)
     {
         _arraySTs[i] = new ArrayST <TKey, TValue>(100);
     }
 }
示例#2
0
        private void Resize(int N)
        {
            var oldArraySTs = _arraySTs;

            HASH_SIZE = N;
            _arraySTs = new ArrayST <TKey, TValue> [N];
            for (int i = 0; i < oldArraySTs.Length; i++)
            {
                _arraySTs[i] = new ArrayST <TKey, TValue>(oldArraySTs.Length * 2);
                if (oldArraySTs[i] != null)
                {
                    for (int j = 0; j < oldArraySTs[i].Count; j++)
                    {
                        var node = oldArraySTs[i][j];
                        _arraySTs[i].Put(node.Key, node.Value);
                    }
                }
            }
        }