Example #1
0
        public void Remove(Key key)
        {
            LinkedList3 <Key, Value> list = hashtable[Hash(key)];

            if (list.Contains(key))
            {
                list.Remove(key);
                N--;
            }
        }
Example #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++;
            }
        }
Example #3
0
 //O(n)
 public bool ContainsKey(Key key)
 {
     return(list.Contains(key));
 }
Example #4
0
        public bool Contains(Key key)
        {
            LinkedList3 <Key, Value> list = hashtable[Hash(key)];

            return(list.Contains(key));
        }