Exemplo n.º 1
0
        public void Remove(Key key)
        {
            LinkedList1 <Key> list = hashtable[Hash(key)];

            if (list.Contains(key))
            {
                list.Remove(key);
                N--;
            }
        }
Exemplo 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>();
     }
 }
Exemplo n.º 3
0
        public void Add(Key key)
        {
            LinkedList1 <Key> list = hashtable[Hash(key)];

            if (list.Contains(key))
            {
                return;
            }
            else
            {
                list.AddFirst(key);
                N++;
            }
        }
Exemplo n.º 4
0
 public LinkedList1Stack()
 {
     list = new LinkedList1 <E>();
 }
Exemplo n.º 5
0
        public bool Contains(Key key)
        {
            LinkedList1 <Key> list = hashtable[Hash(key)];

            return(list.Contains(key));
        }
Exemplo n.º 6
0
 public LinkedList1Queue()
 {
     list = new LinkedList1 <E>();
 }
Exemplo n.º 7
0
 public LinkedList1Set()
 {
     list = new LinkedList1 <E>();
 }