/* * Student First Name: * Student Last Name: * Student BU Number: * Purpose: */ public class Set { private static final int DEFAULT_SIZE = 10; // default size of initial set private int[] set; // array referece to the set private int next; // index to next available slot in the set array /* * Constructors */ public Set() { // your code here } /** * This method reallocates the array set to twice as * big and copies all the elements over. * This method is called only by the insert method * when it cannot insert another element to the set. * */ private void resize() { // Create a new array double the size int[] temp = new int[set.length*2]; // Copy all the elements from the current set // to the new set for(int i = 0; i < set.length; ++i) { temp[i] = set[i]; } // Assign to the set reference the newly // resized array that represents the set. set = temp; } /* * Implement remaining methods as specified by the problem set */ }