Can any one give me the java code for calculating the union of two integer arrays?
If you’re using Java 5 and later, the java.util.Set class gives you all the functionality you would need to calculate the union of two sets. Just remember: – a set is a collection of distinct (unique) objects – the union of two sets is a set containing elements from both sets How you might want to structure your code: – initialize two java.util.Set objects, one for each of the sets A and B – perform the operation to combine the two sets to give you the union Saying any more would pretty much give the answer away. Hopefully this will be enough for you to get the answer on your own. Good luck!