7. Hashing - I

  • In this lab we continue implementing our own data structure library.

  • You will implement the following UML in Java:

../../_images/uml_hashing.drawio.png

7.1. Hashing - Start

  1. Create a package hashtables.

  2. Create the interface JDHashMap.

7.2. Hashing - Hashtable

  1. Create the structure of the generic class HashTable.

  2. Create the generic and static class Entry<K, V> inside HashTable.

    • It contains only two data fields.

    • Implement the constructor Entry(K key, V value).

    • Implement the methods K getKey(), V getValue() and V setValue(V val)

    • Implement the method toString().

7.3. Hahsing - HashTableChain

  1. Create the generic class HashTableChain.

    • You will implement the constructor HashTableChain()

    • It contains only three data fields:

      • ArrayList<Entry<K, V>>[] table

      • static final int START_CAPACITY

      • int numKeys

  2. Implement all the function from the interface.

  3. Make sure that your code works.

ENSURE WE HAVE RECORDED YOUR COMPLETION. FAILURE TO DO SO WILL RESULT IN A GRADE OF 0!