/* * Student First Name: * Student Last Name: * Student BU Number: * Purpose: */ public class Set { private static final int SIZE = 10; // default size of initial set private int[] set; // array referece to the set private int size; // current size of the set private int next; // index to next available slot in the set array public Set() { // your code here } public Set(int[] A) { // your code here } public Set clone() { // your code here return this; // just to get it to compile; replace this with something appropriate } // This method reallocates the array set to twice as big and copies all the elements over. // It is called only by insert. // // Note that this is the reason that in this class // the member size is not a class variable (i.e. static) // and it is not final, because the set can grow and size // will be modified accordingly. private void resize() { size *= 2; int[] temp = new int[size]; for(int i = 0; i < set.length; ++i) { temp[i] = set[i]; } set = temp; } public String toString() { // your code here return null; // just to get it to compile; replace null with something appropriate } public int cardinality() { // your code here return 0; // just to get it to compile; replace 0 with something appropriate } public boolean isEmpty() { // your code here return false; // just to get it to compile; replace false with something appropriate } public boolean member(int k) { // your code here return false; // just to get it to compile; replace false with something appropriate } public boolean subset(Set T) { // your code here return false; // just to get it to compile; replace false with something appropriate } public boolean equal(Set T) { // your code here return false; // just to get it to compile; replace false with something appropriate } public void insert(int k) { // your code here } public void delete(int k) { // your code here } public Set union(Set T) { // your code here return null; // just to get it to compile; replace null with something appropriate } public Set intersection(Set T) { // your code here return null; // just to get it to compile; replace null with something appropriate } public Set setdifference(Set T) { // your code here return null; // just to get it to compile; replace null with something appropriate } }