public void Remove(Key key) { LinkedListThree <Key, Value> lst = hashtable[Hash(key)]; if (lst.Contains(key)) { lst.RemoveEle(key); N--; } }
public HashSTTwo(int M) { this.M = M; N = 0; hashtable = new LinkedListThree <Key, Value> [M]; for (int i = 0; i < M; i++) { hashtable[i] = new LinkedListThree <Key, Value>(); } }
public void Add(Key key, Value value) { LinkedListThree <Key, Value> lst = hashtable[Hash(key)]; if (lst.Contains(key)) { lst.Set(key, value); } else { lst.Add(key, value); N++; } }
public LinkedListThreeDictionary() { list = new LinkedListThree <Key, Value>(); }
public void Set(Key key, Value newValue) { LinkedListThree <Key, Value> lst = hashtable[Hash(key)]; lst.Set(key, newValue); }
public Value Get(Key key) { LinkedListThree <Key, Value> lst = hashtable[Hash(key)]; return(lst.Get(key)); }
public bool Contains(Key key) { LinkedListThree <Key, Value> lst = hashtable[Hash(key)]; return(lst.Contains(key)); }