Пример #1
0
        public void Remove(Key key)
        {
            LinkedList3 <Key, Value> list = hashtable[Hash(key)];

            if (list.Contains(key))
            {
                list.Remove(key);
                N--;
            }
        }
Пример #2
0
        public void Add(Key key, Value value)
        {
            LinkedList3 <Key, Value> list = hashtable[Hash(key)];

            if (list.Contains(key))
            {
                list.Set(key, value);
            }
            else
            {
                list.Add(key, value);
                N++;
            }
        }
Пример #3
0
 //O(n)
 public bool ContainsKey(Key key)
 {
     return(list.Contains(key));
 }
Пример #4
0
        public bool Contains(Key key)
        {
            LinkedList3 <Key, Value> list = hashtable[Hash(key)];

            return(list.Contains(key));
        }