Question: 6. (10 points) Consider an object that represents a polynomial1 A Polynomial has-a list of coefficients. For this problem, let's assume those coefficients are integers.


6. (10 points) Consider an object that represents a polynomial1 A Polynomial has-a list of coefficients. For this problem, let's assume those coefficients are integers. Some examples of polynomials and their lists of coefficients are shown below: Polynomial List of Coefficients 3x2- 2x +5 5r3 +3 02+0 list 3,-2,5 [5,0,0,3 The last 3 rows of the above table have polynomials that all equal each other. Lead ing 0s are never present in the list of coefficients for any polynomial Below are various implementations of .hashCode) for Polynomial If the implementation is incorrect, say why . Otherwise, discuss how well the implementation will or will not satisfy the Sim- ple Uniform Hashing assumption when used by a hash table as the key k for a Polynomial. Be specific and give examples to illustrate your claim (a) (2 points) public int hashCode) [ return 5; points public int hashCode() [ return (int) (Math.random )*100)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
