gpt4 book ai didi

Java集合: Does concrete class HashSet which uses Hash table implemented using LinkedList as its data structure?

转载 作者:行者123 更新时间:2023-12-01 17:34:58 26 4
gpt4 key购买 nike

在《Khalid Mughal 的 Java SCJP 认证程序员指南 - 第 3 版》一书中,第 782 页,我注意到它说具体类 HashSet 是使用哈希表和链表实现的。当我浏览主要的java教程网站http://download.oracle.com/javase/tutorial/collections/implementations/index.html时,看来不是真的。请指教。谢谢。

最佳答案

HashSetHashMap 的包装器,后者又使用数组。 HashMap 是一个哈希表,但不是 Hashtable 类。除了解决冲突之外,HashSet 与列表没有任何关系。

LinkedHashSet 也有自己的链表,但不使用 LinkedList 类。

关于Java集合: Does concrete class HashSet which uses Hash table implemented using LinkedList as its data structure?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7450159/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com