Given two Unsorted arrays that represent two sets (elements in every array are distinct), find the union and intersection of two arrays. For example, if the input arrays are: arr1[] = {7, 1, 5, 2, 3, ...
Initialize union U as empty. Copy all elements of first array to U. Do following for every element x of second array: If x is not present in first array, then copy x to U. Initialize intersection I as ...