static void Main(string[] args) { HashTable h = new HashTable(); h.Ekle(2); h.Ekle(12); h.Ekle(22); h.Ekle(32); h.Ekle(42); h.Ekle(52); h.Ekle(62); h.Ekle(72); h.Ekle(82); h.Ekle(92); h.Ekle(102); h.Ekle(112); h.Ekle(44); h.Cikar(112); h.Cikar(42); var v = h.Getir(12); var v2 = h.Getir(42); Console.WriteLine(v); Console.WriteLine(v2); h.Ekle(36); HashTable2 h2 = new HashTable2(); h2.Ekler(33); h2.Ekler(43); h2.Ekler(23); h2.Ekler(53); h2.Ekler(63); h2.Ekler(73); h2.Ekler(83); h2.Cikarir(83); h2.Ekler(3); //Console.WriteLine(h.Getir(24)); }
static void Main(string[] args) { int size = 100; HashTable1 hashtable1 = new HashTable1(size); for (int i = 0; i < size; i++) { hashtable1.Add(i); } hashtable1.Remove(3); LinkedList <int> list1 = hashtable1.Find(3); // тест 2го варианта хэш-таблицы HashTable2 <int, string> hashtable2 = new HashTable2 <int, string>(size); hashtable2.Add(1, "1"); hashtable2.Add(2, "2"); hashtable2.Add(3, "3"); hashtable2.Remove(3); hashtable2.Add(4, "4"); string first = hashtable2.Find(1); string second = hashtable2.Find(2); string fourth = hashtable2.Find(4); Console.WriteLine($"{first}, {second}, {fourth}"); hashtable2.RemoveAll(); Console.ReadLine(); }