I was reading an article in which they explained the JAVA HashSet uses HashMap internally as a backing store. So question arrises, Why don't they have separate implementation for HashSet as keeping HashMap requires {Key, Value}, However HashSet requires only {Key}. Doesn't this type of implementation wastes double the memory?
Asked
Active
Viewed 52 times