Java中的散列表、樹所對應的容器類,HashMap如何解決衝突

散列表:.net HashMap、Hashtable、concurrentHashMap、HashSetblog 樹:table TreeMap、TreeSetclass 解決衝突:鏈表 鏈地址法。 在Java1.8後採用鏈表法+紅黑樹實現,當鏈表長度超過閾值(8)時,將鏈表轉換成紅黑樹。會減小查詢時間。查詢 轉載於:https://my.oschina.net/u/3938912/blog/30
相關文章
相關標籤/搜索