数据结构-HashMap Hashtable HashSet

They are entirely different constructs. A HashMap is an implementation of Map. A Map maps keys to values. The key look up occurs using the hash.

On the other hand, a HashSet is an implementation of Set. A 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/




你可能感兴趣的:(数据结构,数据结构)