Пример #1
0
  public static void main(String args[]) {
    HashTable ht = new HashTable(30);

    String[] arrayWithData = {"1", "5", "9", "11", "25"};

    ht.hashFunction1(arrayWithData, ht.theArray);
    ht.displayTheStack();

    System.out.println("\n \n");

    HashTable ht2 = new HashTable(30);

    String[] arrayWithData1 = {
      "1", "5", "9", "11", "25", "64", "78", "112", "164", "235", "456", "420", "535", "355", "888",
      "999", "666", "555", "333", "222", "753", "357", "159", "951", "459", "956", "235", "876",
      "451", "237"
    };

    ht2.hashFunction2(arrayWithData1, ht2.theArray);
    ht2.displayTheStack();

    System.out.println("\n \n");

    HashTable ht3 = new HashTable(250);

    String[] arrayWithData2 = {"ku", "pq", "gh", "xy", "hj", "yu"};

    ht3.hashFunction3(arrayWithData2, ht3.theArray);
    ht3.displayTheStack();
  }