Question: JAVA CODE Given two unsorted arrays that represent two sets (elements in every array are distinct), find union and intersection of two arrays. For example,
JAVA CODE

Given two unsorted arrays that represent two sets (elements in every array are distinct), find union and intersection of two arrays. For example, if the input arrays are: int/ list1 = {10, 12, 5, 4, 7, 8); int list2 = {7, 8, 11, 20, 10); Then your program should print Union as {7, 8, 10, 11, 12, 5, 4, 20; and Intersection as {7,8, 10). Note that the elements of union and intersection can be printed in any order
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
