Question: package edu.ser222.m03_04; /** * A symbol table implemented using a hashtable with linear probing. * * @author (put your name here), Sedgewick and Wayne, Acuna

 package edu.ser222.m03_04; /** * A symbol table implemented using a hashtablewith linear probing. * * @author (put your name here), Sedgewick and

package edu.ser222.m03_04;

/**

* A symbol table implemented using a hashtable with linear probing.

*

* @author (put your name here), Sedgewick and Wayne, Acuna

*/

import java.util.LinkedList;

import java.util.Queue;

public class CompletedLinearProbingHT implements ProbingHT {

//any constructors must be made public

@Override

public int hash(Key key, int i) {

//TODO

return 0;

}

@Override

public void put(Key key, Value val) {

//TODO

}

@Override

public Value get(Key key) {

//TODO

return null;

}

@Override

public void delete(Key key) {

//TODO

}

@Override

public boolean contains(Key key) {

//TODO

return false;

}

@Override

public boolean isEmpty() {

//TODO

return false;

}

@Override

public int size() {

//TODO

return 0;

}

@Override

public Iterable keys() {

//TODO

return null;

}

////////////////////////////////////////////////////////////////////////////////////////////////

// THESE METHODS ARE ONLY FOR GRADING AND COME FROM THE PROBINGHT INTERFACE.

@Override

public int getM() {

//TODO. We suggest something like:

//return M;

return 0;

}

@Override

public Object getTableEntry(int i) {

//TODO. We suggest something like:

//return entries[i];

return 0;

}

}

PLEASE DO EVERYTHING THAT SAYS TODO

Write a class called CompletedLinearProbingHT that implements a linear probe hashtable. | 32 points total =26 points +6 extral - Proper hash calculations: * Use the basic hash function given in the slides: hash (k,i)=((khashCode()& 0x7ffffff )+i) \% M, where k is the key and i is the number of collisions. Each time there is a collision, this will increase the hash by 1 . * Do not use parallel arrays. (This will be checked manually.) - LinearProbingHT() - a constructor that defaults to an array of size 997. - void put(Key key, Value val) - see interface. - Value get(Key key) - see interface. - void delete(Key key) - see interface. Do not degrade performance by using tags or extra nulls; you must update the probe sequence containing the element being deleted. [6 points extra credit] - boolean contains(Key key) - see interface. - boolean isEmpty() - see interface. - int size () - see interface. - Iterable keys( ) - see interface. - There is no requirement to support array resizing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!