Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Describe in text how you would write a hashcode function for a key of type doubl

ID: 3862791 • Letter: D

Question

Describe in text how you would write a hashcode function for a key of type double. Explain how you believe this will keep hash operations to constant time. Additionally, justify your function for resize(). What N did you choose to grow or shrink the table and why? Again, explain using an argument for complexity. Describe how you would compare two hash tables to see if they are equal. Things you may want to talk about is, what does equal mean? Can two hash tables be equal when one runs in O(n) and the other in O(1) time?

Explanation / Answer

Describe how you would compare two hash tables to see if they are equal. Things you may want to talk about is, what does equal mean? Can two hash tables be equal when one runs in O(n) and the other in O(1) time?

If from equal, we have a tendency to mean the corresponding worth at each index ar equal, then, we will retell through each component of the hash table and check the corresponding values. If all of them are equal, we say that the hash tables are equal.

By the higher than definition of equal hash table, it's going to be potential that 2 hash tables be equal once one runs in O(n) and also the different in O(1) time. Perhaps one is mistreatment linear inquiring, and one is chaining!