CS 07 Project 7: set operations 1 What is a set? *A collection of items of the same type. Stored in the some container and no duplicates allowed The ordering of the objects within the container is of no importance *equals method must be defined on the elements of the set to be able to compare new elements brought into the set to avoid duplication ALL OF THESE OPERATIONS CREATE A THIRD SET BUT DO NOT MODIFY THE FIRST TWO SETS (BINARY OPERATIONS) ASSUME: set1 = { A,B,C,D } set2 = { C,D,E,F } UNION set1 + set2 = { A,B,C,D,E,F } // all elements combined minus duplicates INTERSECTION set1 * set2 = { C,D } // only the elements in common between them DIFFERENCE set1 - set2 = set1 with the intersection elements removed set1 - set2 = { A,B } XOR (exclusive or) written as set1 xor set2 set1 xor set2 = union(of the two sets) - intersection(of the two sets) = { A,B,C,D,E,F } - { C,D } = { A,B,E,F } equals method must be defined to be able to test new strings brought into the set to avoid duplication