import java.util.*; class IntSet8 { // Constructive sets represented as arrays of integers // Includes union and intersection methods that use method 'add' private int[] array; public IntSet8() { array = new int[0]; } private IntSet8(int[] a) { array = a; } public IntSet8 delete(int n) { int i; for(i=0; in) { int[] array1 = new int[array.length+1]; for(int j=0; ji; j--) array1[j]=array[j-1]; return new IntSet8(array1); } return this; } public boolean member(int n) { int from=0, to=array.length; int mid=(from+to)/2; while(from!=to&&array[mid]!=n) { if(array[mid]>n) to=mid; else from=mid+1; mid=(from+to)/2; } return from!=to; } public String toString() { int i; String str="{"; if(array.length>0) { str+=array[0]; for(i=1;i