Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are to implement 2 different hash tables, with different hashing functions.

ID: 643436 • Letter: Y

Question

You are to implement 2 different hash tables, with different hashing functions. All of them should implement the following interface:


public interface HashTable<K extends Comparable<K>,V> {

   public void add(K key, V value);

   public V remove(K key);

   public V lookup(K key);

   public V[] getSortedList(V[] list);

   public void printReport();

}

The printReport() method should print to the console the following statistics:

The 2 types of hashing functions you are to implement are:

The hash tables should implement resizing and rehashing. The V[] getSortedList(V[] list) method should return a sorted list with all the elements in the array.

You will use a stack and a queue to implement a scambled version of the rotational hashing function. Before applying the rotational hash to the string, you will implement a function that will scramble the characters in the string so that every 3 successive characters in the string are inverted. For example, if the string to be hashed is "Jonathan", then the function should turn the string into "noJhtana" before applying the rotational hash. This function can be easily implemented using a stack and a queue.

Now that you've implemented the hash tables you will use to implement a ver simple registry for students' records. You will create a class to keep student's information: name, student ID, and grade. The program will have the following functionality:

Remember that the registry must be persistent, so you will have to save all this information to the file system. You may use any of the versions of hash tables implemented in the previous exercise.

Explanation / Answer

public interface HashTable<K extends Comparable<K>,V> {

public void add(K key, V value);

public V remove(K key);

public V lookup(K key);

public V[] getSortedList(V[] list);

public void printReport();

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote