您的位置:首页 > 理论基础 > 数据结构算法

数据结构-HashMap Hashtable HashSet

2015-03-04 00:24 351 查看
They are entirely different constructs. A 
HashMap
 is
an implementation of 
Map
.
Map maps keys to values. The key look up occurs using the hash.

On the other hand, a 
HashSet
 is
an implementation of 
Set
.
Set is designed to match the mathematical model of a set. A 
HashSet
 does
use a 
HashMap
 to
back its implementation, as you noted. However, it implements an entirely different interface.

HashMap:

http://www.pakzilla.com/2009/08/24/hashmap-vs-hashtable-vs-hashset/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  数据结构