Java Question: you will implement a variant of an interesting open addressing ha
ID: 3573923 • Letter: J
Question
Java Question:
you will implement a variant of an interesting open addressing hashing strategy known as cuckoo hashing. Two independent hash functions are used, and computed for each key that is to be inserted into the hash table. An element is always stored in one of the two cells indicated by those hash functions. When a new element is inserted, if either of those two cells is available, it is placed there. Otherwise, it is placed into one of its choice of locations, but evicts another entry. In the case of an eviction, the evicted entry is then placed into its alternate choice of locations using the hash functions, which could potentially evict another entry. See the book or other resources for simply hash functions. They can be very simple. Check out the “Compression Functions” in the book to map to an index value based on the key (the element you’re trying to place.) Assume your project will check only integer values. With this variant, assume that you will need to count the number of times you have to do an eviction in a row. If you end up having to evict 3 elements, then on the 4 th try, just use linear probing until an open spot is found, placing the element there. However, you may find that the list is full, and you should then throw an exc eption that you must create: a CuckooHashFailedException
Explanation / Answer
Hii there check this code for help :
code
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.