Ejemplo n.º 1
0
 public void Initialize()
 {
     hashFunction1 = new HashFunction1();
     hashFunction2 = new HashFunction2();
     hashTable1 = new HashTable(5, hashFunction1);
     hashTable2 = new HashTable(5, hashFunction2);
 }
Ejemplo n.º 2
0
        public void TestChangeHashFunction()
        {
            HashFunction hashfunction2 = new HashFunction2();

            hash.InsertToHashTable(20);
            hash.InsertToHashTable(15);

            hash.ChangeHashfunction(hashfunction2);

            Assert.IsTrue(hash.Exist(15));
        }
Ejemplo n.º 3
0
        public void ChangeHashFunctionTest()
        {
            hashTable.AddValue("ab");
            hashTable.AddValue("12345");
            hashTable.AddValue("A1bc2");

            IHashFunction func2 = new HashFunction2();

            hashTable.ChangeHashFunction(func2);

            Assert.IsTrue(hashTable.Contains("ab"));
            Assert.IsTrue(hashTable.Contains("12345"));
            Assert.IsTrue(hashTable.Contains("A1bc2"));
        }