public void put(string key, int val) { hash.put(key); int i = hash.find(key); hash.value[i] = val; cnt++; }
static void Main(string[] args) { HashTable hash = new HashTable(17, 3); hash.put("first message"); hash.put("я сделал это!"); hash.put("думал, что очень сложно"); hash.put("надеюсь, правильно"); for (int i = 0; i < hash.capacity; i++) { if (hash.check[i]) { Console.Write("Под индексом " + i + " строка: " + hash.arr[i]); Console.WriteLine(); } } Console.WriteLine(); Console.ReadLine(); }