Guest User

Untitled

a guest
Jan 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. public V put(K key, V value) {
  2. int hash = hash(key.hashCode());
  3. int i = indexFor(hash, table.length);
  4. .....
  5. }
  6.  
  7.  
  8. static int hash(int h) {
  9. h ^= (h >>> 20) ^ (h >>> 12);
  10. return h ^ (h >>> 7) ^ (h >>> 4);
  11. }
  12.  
  13.  
  14. static int indexFor(int h, int length) {
  15. return h & (length-1);
  16. }
Add Comment
Please, Sign In to add comment