Problem statement: Write a program in java, to compute the union of two large sets.(1 million in each set)
Details: Two sets, A and B, will be provided in the form of two text files 'A.txt' and 'B.txt'. Write a program to read these files into memory, and compute their union. The union of these sets should be written to another file, 'union.txt'. It may be noted that the input sets, A and B, are very large sets containing over a million elements each. Enough thought should be put into the choice of data structures for this program, as it will have a bearing on the efficiency of the program. Also, the design of the program should be well thought out--for example, minimizing the number of passes for reading the input, minimizing the number of times a particular value is computed, etc.
Deliverables:
* the code
* total execution time (measured in terms of CPU time, and not wallclock time)
* a short design document explaining: (a) the algorithm, and (b) the main data structures, along with a justification for their choice.