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

JAVA CODE Given two unsorted arrays that represent two sets (elements in

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!