Exemple #1
0
        public bool Contains(string value)
        {
            int hash = HashFunction.Hash(value);

            if (string.IsNullOrEmpty(_table[hash]))
            {
                return(false);
            }

            return(_table[hash].Equals(value) || _sll.Contains(value));
        }
Exemple #2
0
        public void Put(string value)
        {
            var hash = HashFunction.Hash(value);

            if (_table[hash] == null)
            {
                _table[hash] = new LinkedList <string>();
            }

            _table[hash].AddLast(value);
        }
Exemple #3
0
        public void Put(string value)
        {
            int hash = HashFunction.Hash(value);

            if (string.IsNullOrEmpty(_table[hash]))
            {
                _table[hash] = value;
            }
            else
            {
                _sll.Add(value);
            }
        }
Exemple #4
0
        public bool Contains(string value)
        {
            var hash = HashFunction.Hash(value);

            return(_table[hash] != null && _table[hash].Contains(value));
        }