Reimplement the set class from Exercise P16.15, supply methods

IntSet union(IntSet other)
IntSet intersection(IntSet other)

that compute the union and intersection of two sets.

Complete the following file:

IntSet.java

Use the following file:

IntSetTester.java

/**
   A test program to test the IntSet class.
*/
public class IntSetTester
{  
   public static void main(String[] args)
   {  
      IntSet s = new IntSet();
      s.add(2);
      s.add(3);
      s.add(5);
      s.add(7);
      s.add(11);

      IntSet t = new IntSet();
      t.add(3);
      t.add(6);
      t.add(9);

      s.union(t).print();
      System.out.println("Expected: 2 3 5 6 7 9 11");
      s.intersection(t).print();
      System.out.println("Expected: 3");
   }
}