예제 #1
0
        public void Remove(Key key)
        {
            LinkedListThree <Key, Value> lst = hashtable[Hash(key)];

            if (lst.Contains(key))
            {
                lst.RemoveEle(key);
                N--;
            }
        }
예제 #2
0
 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>();
     }
 }
예제 #3
0
        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>();
 }
예제 #5
0
        public void Set(Key key, Value newValue)
        {
            LinkedListThree <Key, Value> lst = hashtable[Hash(key)];

            lst.Set(key, newValue);
        }
예제 #6
0
        public Value Get(Key key)
        {
            LinkedListThree <Key, Value> lst = hashtable[Hash(key)];

            return(lst.Get(key));
        }
예제 #7
0
        public bool Contains(Key key)
        {
            LinkedListThree <Key, Value> lst = hashtable[Hash(key)];

            return(lst.Contains(key));
        }