All #\'s unsigned. You are to write a program (in Java) to computethe intersecti
ID: 3617055 • Letter: A
Question
All #'s unsigned. You are to write a program (in Java) to computethe intersection and union of two sets A and B. The Universeset has 128 elements numbered from 1 to 128. That is U = {1,2, 3, 4,…, 128}. Your program must use NO more than 16memory locations to represent four sets A, B, C, and D. Theelements of each set are represented in bitformat. An elementin a set is marked by a 1. The missing elements are marked by a0.
For example, unsigned a[0] = 0x80010001, a[1] = 0x80010001, a[2] = 0x80010001, a[3] = 0x80010001;
defines the elements of set A inbit-format. The elements are numbered from left to right. For example, bit-pattern of a[0]indicates that elements 1, 16, and 32 are in set A, bit-pattern ofa[1] indicate that elements 33, 48, and64 are also in set A, and so on.
Do thefollowing: 1) Determine the elements of C = A B in bit-format. Hint: Use the bit-wise AND operator (&). Print set C inbit-format.
( | ). Print set D inbit-format.
3) Convert the bit-format of sets Cand D to the list of actual elements. Specifically, write a function and call it twice oncepassing set C and second time passing set D. This function converts the bit-pattern toa list of actual elements. A sample output for set A is given below.