+ 3

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

9th Mar 2017, 11:47 AM
Timo B.
Timo B. - avatar
1 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
10th Mar 2017, 5:07 AM
Michael Szczepanski
Michael Szczepanski - avatar