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

            if (list.Contains(key))
            {
                list.Remove(key);
                N--;
            }
        }
Example #2
0
 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>();
     }
 }
Example #3
0
        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>();
 }
Example #5
0
        public bool Contains(Key key)
        {
            LinkedList1 <Key> list = hashtable[Hash(key)];

            return(list.Contains(key));
        }
 public LinkedList1Queue()
 {
     list = new LinkedList1 <E>();
 }
Example #7
0
 public LinkedList1Set()
 {
     list = new LinkedList1 <E>();
 }