CS 10C Programming Concepts and Methodologies 2

Project 31.2

Add member functions setUnion(), setIntersection(), and setDifference().

The functions should all return the resulting LinkedSet object. We won't need to throw a CapacityExceeded exception in the setUnion() function, because the Set will have unlimited capacity. You'll still need the DuplicateItemError exception in your insert() function.

You may use contains() and the Node class accessors and mutators, but, other than those, do not use any explicit function calls in your definitions of these three functions! The operations must be coded without explicitly calling any other functions to help. The practice manipulating the pointers directly will be extremely valuable.

(You may also use calls to constructors and the assignment operator. The word "explicitly" in the above paragraph is intended to allow for you to call constructors and the assignment operator, since those are not explicit function calls.)

Again, the point here is to practice with linked list manipulations. Any attempt to work around this (such as storing the Set in an array or vector first and then performing the operation) will result in a grade of 0.)

For documentation, you must provide function documentation for any new functions that you are writing (setUnion(), setIntersection(), setDifference()). No other documentation is required.