You are to implement the fundamental set operations: union, intersection, xor and difference. You are given the methods to upSize and downSize an array. You should write a linearSearch that searches an array for an element. Do not write loops everywhere where a search is needed. Write the search method and call it from all the places you need to search a set for the presence of an element. Do not change anything in main. Remember that you are not to modify the original arrays once they have been loaded from the files. All the set operations are passive. They do not alter the sets. Instead they always return a third array which is the result of the operation. The returned array must be trimmed to fit the actual count.
Note that the given code in main sorts the set as soon as it is created. This is just to make it easier to see which elements are in the sets. You do not have to use binary search or any algorithms that take advantage of sorting. You can do simple linear searching using a for loop.
For the xor method you are not allowed to write loops or even declare any arrays! You must generate the xor of the two incoming arrays with nothing but calls to the other set operations already defined (recall the Fraction arithmetic operations were one liners too). You must write the entire method in a single one line return statement.