Organizational Research By

Surprising Reserch Topic

hashmap implementation in java how does the bucket index calculation work using -'java,hashmap'


hashmap implementation in java how does the bucket index calculation work  using -'java,hashmap'

I am looking at the implementation of HashMap in Java and am stuck at one point.
How is the indexFor function calculated?

static int indexFor(int h, int length) {
   return h & (length-1);
}


Thanks
    
asked Sep 7, 2015 by rajesh
0 votes
10 views



Related Hot Questions



Government Jobs Opening


...