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

            if (list.Contains(key))
            {
                list.Remove(key);
                N--;
            }
        }
Пример #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>();
     }
 }
Пример #3
0
        public void Add(Key key)
        {
            LinkedList1 <Key> list = hashtable[Hash(key)];

            if (list.Contains(key))
            {
                return;
            }
            else
            {
                list.AddFirst(key);
                N++;
            }
        }
Пример #4
0
 public LinkedList1Stack()
 {
     list = new LinkedList1 <E>();
 }
Пример #5
0
        public bool Contains(Key key)
        {
            LinkedList1 <Key> list = hashtable[Hash(key)];

            return(list.Contains(key));
        }
Пример #6
0
 public LinkedList1Queue()
 {
     list = new LinkedList1 <E>();
 }
Пример #7
0
 public LinkedList1Set()
 {
     list = new LinkedList1 <E>();
 }