Monday, 30 September 2013

Find out whether two HashSets have a duplicate value

Find out whether two HashSets have a duplicate value

I need a function like the following,
boolean hasDuplicateValue(HashSet hs1, HashSet hs2) {
// return false;
}
This thread Efficiently finding the intersection of a variable number of
sets of strings discusses a similar issue, however in this thread they
also need the intersection values, which I do not need. So, it may add an
additional computational complexity which I do not need.

No comments:

Post a Comment