久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

HashMap 沖突是否會導(dǎo)致調(diào)整大小?

Does a HashMap collision cause a resize?(HashMap 沖突是否會導(dǎo)致調(diào)整大小?)
本文介紹了HashMap 沖突是否會導(dǎo)致調(diào)整大小?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

如果在放入 HashMap 期間發(fā)生沖突,是調(diào)整映射大小還是將條目添加到特定存儲桶中的列表中?

When there is a collision during a put in a HashMap is the map resized or is the entry added to a list in that particular bucket?

推薦答案

當(dāng)你說'碰撞'時,你的意思是相同的哈希碼嗎?hashcode 用于確定要使用 HashMap 中的哪個桶,桶由具有相同 hashcode 的所有條目的鏈表組成.然后在返回或引導(dǎo) (get/put) 之前比較條目是否相等(使用 .equals()).

When you say 'collision', do you mean the same hashcode? The hashcode is used to determine what bucket in a HashMap is to be used, and the bucket is made up of a linked list of all the entries with the same hashcode. The entries are then compared for equality (using .equals()) before being returned or booted (get/put).

請注意,這是專門的 HashMap(因為這是您詢問的那個),以及其他實現(xiàn),YMMV.

Note that this is the HashMap specifically (since that's the one you asked about), and with other implementations, YMMV.

這篇關(guān)于HashMap 沖突是否會導(dǎo)致調(diào)整大小?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Convert List of Strings into Map using Java-8 Streams API(使用 Java-8 Streams API 將字符串列表轉(zhuǎn)換為 Map)
Getting data from JSON(從 JSON 獲取數(shù)據(jù))
java linkedhashmap iteration(javalinkedhashmap迭代)
Converting a list of objects to Map(將對象列表轉(zhuǎn)換為 Map)
Create a HashMap with a fixed Key corresponding to a HashSet. point of departure(用一個固定的Key對應(yīng)一個HashSet創(chuàng)建一個HashMap.出發(fā)點)
HttpMessageConverter exception : RestClientException: Could not write request: no suitable HttpMessageConverter found(HttpMessageConverter 異常:RestClientException:無法寫入請求:找不到合適的 HttpMessageConverter) - IT屋-程序員
主站蜘蛛池模板: 一区二区三区亚洲精品国 | 99久久精品国产麻豆演员表 | 丁香婷婷成人 | 免费视频一区二区 | 久久综合伊人一区二区三 | aa级毛片毛片免费观看久 | 色吧色综合 | 欧美三区 | 伊人狠狠 | 国产欧美日韩综合精品一区二区 | 亚州综合在线 | 老司机精品福利视频 | 91色综合 | 国产精品成人一区 | 日韩快播电影网 | 精品一二区 | 日韩性在线 | 亚洲精品二三区 | 91久久精品一区二区二区 | 色婷婷av99xx | 亚洲国产精品久久久久婷婷老年 | 先锋资源亚洲 | 免费视频二区 | 四季久久免费一区二区三区四区 | 美女网站视频免费黄 | 国产精品欧美一区二区 | 欧美三级电影在线播放 | 亚洲女优在线播放 | 九九导航| 成人免费毛片片v | 午夜免费av| 一区二区三区视频免费观看 | 日韩欧美在线观看 | 国产96在线 | 99国产精品久久久 | 国产精品成人一区二区三区 | 国产日韩欧美在线播放 | 亚洲福利视频一区二区 | 欧美日韩精品一区二区三区四区 | 亚洲精品乱码 | 久产久精国产品 |