put(K, V) process of the jdk 1.8 HashMap
- calculate key hash value
- hash table is null or empty ?
init hash table by invoke resize() that if hash table is null or empty - calculate the index of key in the hash table
- hash conflict
- is want to replace value ?
replace new value - is red-black tree ?
add new node - append element into list
- list size is >= 7 ?
transformed the red-black tree when the list size is >= 7
- list size is >= 7 ?
- is want to replace value ?
- not conflict
put the element into the hash table
- hash conflict
网友评论