public void Remove(Key key) { LinkedList1 <Key> list = hashtable[Hash(key)]; if (list.Contains(key)) { list.Remove(key); N--; } }
public HashST1(int M) { this.M = M; N = 0; hashtable = new LinkedList1 <Key> [M]; for (int i = 0; i < M; i++) { hashtable[i] = new LinkedList1 <Key>(); } }
public void Add(Key key) { LinkedList1 <Key> list = hashtable[Hash(key)]; if (list.Contains(key)) { return; } else { list.AddFirst(key); N++; } }
public LinkedList1Stack() { list = new LinkedList1 <E>(); }
public bool Contains(Key key) { LinkedList1 <Key> list = hashtable[Hash(key)]; return(list.Contains(key)); }
public LinkedList1Queue() { list = new LinkedList1 <E>(); }
public LinkedList1Set() { list = new LinkedList1 <E>(); }