Assignment FAQ Development Guide Code Checklist |
You must turn in your program by Wednesday, November 3rd, 2021 at 11:59am (NOON).
In the assignment, you are to implement a Symbol Table to allow variable
assignment to the calculator. You are also to write the member methods
for the UCSDStudent class as part of the Driver.java file used to test your
symbol table.
Modifications to provided and existing code:
You are to provide the missing code to the member methods in the HashTable.java file, and the missing portions of the UCSDStudent class definition to the Driver.java file. The Hashing algorithm will be double hashing using a bully algorithm to decide between conflicts as discussed in class.
The methods to write in HashTable.java:
public static void debugOn ()
public static void debugOff ()
public HashTable (int sz, String caller)
public void jettison ()
public void getOccupancy ()
private boolean insert (Base element, boolean recursiveCall)
private Base locate (Base element)
public Base lookup (Base element)
Additional code to write in Driver.java:
Add appropriate class methods for UCSDStudent, which we have declared for you.
For all methods in this assignment, make sure to include code to display the corresponding catastrophic error and debug messages.
debugOn:
Turns on debugging for this HashTable.
debugOff:
Turns off debugging for this HashTable.
HashTable:
Allocates and initializes the memory associated with a hash table.
HashTable jettison:
Called when jettisoning this HashTable. Jettisons each Base object stored in the HashTable, and the Tracker object.
getOccupancy:
Called to get the current occupancy of the Hash Table.
insert:
Inserts the element in the hash table. Returns true or false indicating success of insertion.
locate: /* called from insert and lookup */
Locates the index in the table where the insertion is to be performed, an item is found, or an item is determined not to be there. Sets the variable index to the last location checked; it will be used by insert and lookup. Returns the object if you find one, and null if the index is empty.
lookup:
Looks up the element in the hash table. Returns reference to the element if found, null otherwise.
Copy and past the following commands into your terminal
Assignment FAQ Development Guide Code Checklist |