vikky agrawal wrote:Correct me if I am wrong
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Don Redd wrote:I think, the implementation of hashCode() given above is not performance friendly. the main goal of hashing it to map, lets say m elements to n buckets. where m >>>>>>n;
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Don Redd wrote: if m==n, then finding the right bucket will take time, even though equals() is O(1). So,What I meant is, we have to implement hash function in a way that 1) finding right bucket and 2)comparing each element in bucket, are load balanced.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)