Download this zip file and un-zip it. In the zip file there is a copy of this web page, which you can read in your browser, and some files that you need for this assignment.
This assignment is due Monday, October 1.
This assignment is based on Programming Project 6 on page 170 of our textbook (but you don't need to follow any of the instructions given in that project).
In the zip file hw3.zip there is a Java file, IntArraySet.java and its Javadoc html file, IntArraySet.html . In this assignment you will complete the source file IntArraySet.java so that it implements the interface specified in IntArraySet.html .
The IntArraySet data structure is very similar to the IntArrayBag data structure, so quite a bit of the implementation of IntArraySet is very similar to the equivalent implementation of IntArrayBag . The main difference between the two data structures is that a set can contain only one instance of any particular number, but the bag data structure can contain an arbitrary number of copies of any particular number. Also, the set interface contains a few new methods that are not equivalent to any method from the bag data structure. These new methods implement the mathematical operations of set union, set intersection, and set subtraction.
In the zip file hw3.zip there is a Java file, TestIntArraySet.java that you can use to test your implementation of the IntArraySet interface.
Turn in a zip file called CS275Hw3Surname.zip containing IntArraySet.java , its javadoc IntArraySet.html , and the test program TestIntArraySet.java .
This assignment is due Monday, October 1.
|