Quiz 19 (Review Exercise) from Big Java Chap. 20

  1. P20.8 Design a data structure IntSet that can hold a set of integers. Hide the private implementation: a tree set of Integer objects. Provide:
  2. P20.9 Supply an interator object that supports only the hasNext and next methods.
    IntSetIterator it = mySet.iterator() ;
    while (it.hasNext())
      System.out.println(it.next()) ;
  3. P20.10 Add
    IntSet union(IntSet other)
    IntSet intersection(IntSet other)
  4. P20.11