Hash表(上):HashMap 的實現原理精講
https://ke.qq.com/webcourse/index.html#cid=345381&term_id=100410551&taid=2786347148723493&vid=5285890793322487566
html
數組和鏈表,key value的鍵值對,效率高 。知道,get put的原理。 get和put差很少,計算hash碼,求模找到下標。哈希碰撞,用鏈表。輪詢鏈表。擴容。web
*****。數組
由於String Interger 中已經實現了 hashcode()和equals()方法了,性能
能夠,只須要本身實現hashcode()和equals方法3d
hashmap 裏面這個for循環很不錯code
什麼是加載因子htm
hashmap何時性能最差,全部的key得出的hash 求模得出的 下標都同樣的時候,就變成一條單鏈表,blog
TreeMap
LinkedHashMap
HashTable
HashMap
ThreadLocal/SparseArray
SynchronizedHashMap
WeakHashMap
ConcurrentHashMap
ci