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

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

public interface HashTable {

Don't use plagiarized sources. Get Your Custom Essay on
Answered! You are to implement 2 different hash tables, with different hashing functions. All of them should implement the following interface:…
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

public void add(String key, V value);

public V remove(String key);

public V lookup(String key);

public Object[] getValuesList();

public void printReport();

}

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

The Load Factor, that is, the ratio of used to total number of buckets.

The longest chain in the table, that is, the maximum number of collisions for a particular bucket.

The Density Factor, that is, the ratio of elements stored elements to total number of buckets.

The Chanining Factor, that is, the average length of any chain in the table.

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

Additive Hashing

XOR-Shift (Rotational) Hashing

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.

This is for a JAVA PROGRAM also required to use interface also needs to be a String.

public class addHash, V> implements HashTable{

@Override
public void add(String key, V value) {
// TODO Auto-generated method stub

}

@Override
public V remove(String key) {
// TODO Auto-generated method stub
return null;
}

@Override
public V lookup(String key) {
// TODO Auto-generated method stub
return null;
}

@Override
public Object[] getValuesList() {
// TODO Auto-generated method stub
return null;
}

@Override
public void printReport() {
// TODO Auto-generated method stub

}
}

Expert Answer

public class addHash, V> implements HashTable{

@Override
public void add(String key, V value) {
// TODO Auto-generated method stub

}

@Override
public V remove(String key) {
// TODO Auto-generated method stub
return null;
}

@Override
public V lookup(String key) {
// TODO Auto-generated method stub
return null;
}

@Override
public Object[] getValuesList() {
// TODO Auto-generated method stub
return null;
}

@Override
public void printReport() {
// TODO Auto-generated method stub

}
}

Still stressed from student homework?
Get quality assistance from academic writers!