In the previous Homework, you implemented a BST-based integer set ADT.
Our solution is in the solutions directory. In this Homework, you
will modify this code (your solution or our solution) so that we have
an interface IntSet, and abstract base class (put keyword
abstract before the class declaration)
AbstractIntSet that implements this interface and provides
default (possibly inefficient) implementations of some of the methods,
and three concrete classes that inherit from the abstract base class
and provide actual implementations:
java.util.HashTable
which maps Integer objects to themselves (if in the
set) or null (if not in the set). The keys method of
this class which returns a java.util.Enumeration will be very useful.IntSet interface requires the following functionality:
IntSet
and has the same elements.IntIterator.IntIterator interface requires
/afs/cs.uwm.edu/users/classes/cs431/src/homework8/These interfaces should not be changed. We also provide a driver and a skeleton for
AbstractIntSet.
Do Exercise 4 in the textbook (page 318). You will need to do some internet research. Also answer the question:
d. How do parasitic methods address the problem of ``covariant overriding'' ?
You submit your program work by putting it in the homework8 directory
in your AFS class volume.
You may do all your work in this directory, or you may wish to do your
work in a different directory and copy things when correct into this
directory. In any case, you will lose permission to write things in
this directory after the deadline, which is 4:00pm on Tuesday,
April 6th. In other words, you must be done before lecture
starts.
The homework8 directory should include the following: