Re: Task of detecting duplicate values in a HashMap
Posted 18 December 2013 - 07:29 PM
Sounds like you might be going about your problem backwards. Why do you want to go about detecting duplicate values?
Note- you could easily do this by traversing through the EntrySet with nested loops, or use a HashSet and begin to add the values (again by iterating through the EntrySet). If you see no change in size() on the HashSet, your current entry is a duplicate.