Question: Please explain in details the checked answer . Show how it is the answer. Que 30 down 29. If we place n distinct elements into
29. If we place n distinct elements into a hash table of size m using a good hash function, bow many elements do we expect to find in each table position? (n/m (e) O(n) (d) O(m) e) O(nm) 30. Recall the multiplicative hash function hash(x)(x.hashCode2)-d, where w is the uunber of bits in an integer How large is the table that is used with this bash function? (In other words, what is the range of this hash function) (a) (0,.. 2d 31. In more standard mathematical notation, the above hnsh function can be written as (here div denotes integer division without any remainder) (a) hash(x)=(x-hashCode()-z)div2v-d hash(x) ((.bashCodeO z) mod2)div 2*d (e) bashx) (x.bashCode) z) mod 2) div 2 (d) hash(x)=((x. hashCode() , z)mod 2w-d)div2d e)bash(x)-((xashCode) z) mod 2*-d) div2-d 32. Consider the following implementation of a hashCode method that uses the bitwise exclasive-or() operator public class Point2D f Double x, y: public int hashCodeO return x.hashCode y hashCode) Which of the following statements are true about two instances p and qof a Point20? (a) p.hashCode) - if p.x-P.y (b) p.hashCode()q.hashcode() ifp.,, q.yor p.y#4.x (c) p.hashCode()s q.hashCode() if p.x q.y and p.ys q.x (d) Both (a) and (b) are true Both (a) and (c) are true 29. If we place n distinct elements into a hash table of size m using a good hash function, bow many elements do we expect to find in each table position? (n/m (e) O(n) (d) O(m) e) O(nm) 30. Recall the multiplicative hash function hash(x)(x.hashCode2)-d, where w is the uunber of bits in an integer How large is the table that is used with this bash function? (In other words, what is the range of this hash function) (a) (0,.. 2d 31. In more standard mathematical notation, the above hnsh function can be written as (here div denotes integer division without any remainder) (a) hash(x)=(x-hashCode()-z)div2v-d hash(x) ((.bashCodeO z) mod2)div 2*d (e) bashx) (x.bashCode) z) mod 2) div 2 (d) hash(x)=((x. hashCode() , z)mod 2w-d)div2d e)bash(x)-((xashCode) z) mod 2*-d) div2-d 32. Consider the following implementation of a hashCode method that uses the bitwise exclasive-or() operator public class Point2D f Double x, y: public int hashCodeO return x.hashCode y hashCode) Which of the following statements are true about two instances p and qof a Point20? (a) p.hashCode) - if p.x-P.y (b) p.hashCode()q.hashcode() ifp.,, q.yor p.y#4.x (c) p.hashCode()s q.hashCode() if p.x q.y and p.ys q.x (d) Both (a) and (b) are true Both (a) and (c) are true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
