Hashset vs Hashmap | SoloLearn: Learn to code for FREE!

+2

Hashset vs Hashmap

So a hashset stores only diffenent values. Does that mean, that the value is linked to a "names" and the same value can be linked to multiple names? Like an inversed hasmap

3/9/2017 11:47:07 AM

Timo B.

1 Answer

New Answer

+1

not a pro in java. but in hash table data structures, any integers are 99% of the time unique. this is bc they are used as keys. to get the names and such. so usually one to one. one key. one value. if you have a hash set up so that it is n = key, and you have a collision, that should mean that you are inserting the Same data. avoid collision. hope this helps