different entries will be mapped to the same bucket in in this casewe say that collision has occurred clearlyif each bucket of can store only single entrythen we cannot associate more than one entry with single bucketwhich is problem in the case of collisions to be surethere are ways of dealing with collisionswhich we will discuss laterbut the best strategy is to try to avoid them in the first place we say that hash function is "goodif it maps the keys in our map so as to minimize collisions as much as possible for practical reasonswe also would like hash function to be fast and easy to compute following the convention in javawe view the evaluation of hash functionh( )as consisting of two actions--mapping the key to an integercalled the hash codeand mapping the hash code to an integer within the range of indices ([ , ]of bucket arraycalled the compression function (see figure figure the two parts of hash functiona hash code and compression func tion hash codes the first action that hash function performs is to take an arbitrary key in our map and assign it an integer value the integer assigned to key is called the hash code for this integer value need not be in the range [ , ]and may even be negativebut we desire that the set of hash codes assigned to our keys should avoid collisions as much as possible for if the hash codes of our keys cause collisionsthen there is no hope for our compression function to avoid them in additionto be consistent with all of our keysthe hash code we use for key should be the same as the hash code for any key that is equal to