1,277
edits
Changes
m
* Converts a hash code in the range Integer.MIN_VALUE...Integer.MAX_VALUE
/* int returnval = (((6*code + 11) % 536870911) % table.length);
* Create a new Entry object referencing the input key and associated value,
* Remove all entries from the dictionary.
spacing + a comment
/**
* to a value in the range 0...(size of hash table) - 1.
*
int compFunction(int code) {
if (returnval < 0) {
returnval = returnval + table.length;
/**
* and insert the entry into the dictionary. Return a reference to the new
* entry. Multiple entries with the same key (or even the same key and
} else {
table[targetindex].insertFront(insertion);
} tablesize++;
return insertion;
}
while (!((Entry) curnode.item()).key().equals(key)) { // if the current key is not equals() to the one we're looking for, look in the next node
curnode = curnode.next();
} return (Entry) curnode.item(); // found a match w/out throwing exceptions
} catch (list.InvalidNodeException e) { // no match for key in the list
return null;
/**
*/
public void makeEmpty() {
}
/**
* Print statistical info about the hashtable: the number of keys stored in each bucket and the total number of collisions.
*/
public void printHistogram() {
String histog = "";