Activity: Implementing Open Addressing

Scenario

We have been asked to develop an algorithm to search and remove data from a hash table using the open addressing technique.

Aim

To implement a hash table using open addressing with linear probing. 

Prerequisites

To solve this activity, you have to implement the methods found in the class that is available on GitHub at the following URL:

https://github.com/TrainingByPackt/Data-Structures-and-Algorithms-in-Java/blob/master/src/main/java/com/packt/datastructuresandalg/lesson3/activity/openaddressing/OpenAddrHashTable.java

If you have your project set up, you can run the following unit test for this activity by running:

gradlew test --tests com.packt.datastructuresandalg.lesson3.activity.openaddressing*

Steps for Completion

  1. Study the pseudocode shown in Snippet 3.3 and Snippet 3.4
  2. Implement them in Java
  3. Create a container class that will hold your key and value in the hash table
  4. Have a flag on this container to indicate when an item is deleted
  5. Use this flag in the insert operation to overwrite it if it is deleted
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.187