Starting from:
$35

$29

Programming Assignment #3 solution

The assignment is to implement a hash table for strings of characters which uses open addressing and double hashing to resolve collisions. Two hash functions have been provided to use for double hashing. The data structure used to represent the hash table must be an array.




Your implementation must be be able to insert an arbitrary number of strings into the hash table as well as remove strings from the hash table. Furthermore, the load factor of your hash table must remain in the range [0:25; 0:75] at all times. Therefore, when inserting or removing a string that would move the load factor outside this range, the hash table will need to be resized. You may use any resizing scheme you choose.




A Java template has been provided containing empty functions insert, find, remove, and resize. Your task is to write the body of each of the functions. You must use the provided Java template as the basis of your submission, and put your implementation inside the provided functions in the template. You may not change the name, return type or parameters of any of the provided functions. You may add additional functions and classes as needed. Since you are are only permitted to submit one le, any extra classes must be contained in the HashTable.java le.




The main function in the template contains code to help you test your implementation by entering test data or reading it from a le. You may modify the main function, but only the contents of the provided functions (and any functions or classes you have added) will be marked, since the main function will be deleted before marking begins. Please read through the comments in the template le before starting.




Test Datasets



The dataset for this assignment will be a collection of place names (cities, towns, etc.). A set of input les containing test data are available on conneX. You should ensure that your implemen-tation behaves correctly on these test les before submitting. It may also be helpful to test your implementation on a variety of other inputs, since the posted data may not cover all possible cases.



Evaluation Criteria



The programming assignment will be marked out of 40, based on a combination of automated testing (using test data similar to the ones posted on conneX) and human inspection.




Score
Description




0 - 10
Submission does not compile or does not conform to the provided


template.




11 - 20
The implemented hash table is substantially inaccurate on the


tested inputs.




21 - 30
The implemented hash table is partially complete, with some of


the required functions not working correctly.




31 - 40
The implemented hash table is complete and implements each of


the required functions correctly.







To be properly tested, every submission must compile correctly as submitted, and must be based on the provided template. If your submission does not compile for any reason (even trivial mistakes like typos), or was not based on the template, it will receive at most 10 out of 40. The best way to make sure your submission is correct is to download it from conneX after submitting and test it. You are not permitted to revise your submission after the due date, and late submissions will not be accepted, so you should ensure that you have submitted the correct version of your code before the due date. conneX will allow you to change your submission before the due date if you notice a mistake. After submitting your assignment, conneX will automatically send you a con rmation email. If you do not receive such an email, your submission was not received. If you have problems with the submission process, send an email to the instructor before the due date.














































































2

More products