- public class MainHw2
- extends java.lang.Object
This is a sample program to use with your homework #2. You will note
it looks similar to the old MainHw1 program; however, I have make various
modifications to make it easier to use.
The differences are that
- it uses
new possibilities for
the type of
- the iterators for
HashSetSeparateChaining do not return the
elements in the set in any particular order.
- the "contains" function must also be written for
(The default implementation in
inappropriate as it works by creating an iterator and sequentially
seeking for theelement.
This is a initial main program for testing purposes.
|Methods inherited from class java.lang.Object
public static void main(java.lang.String args)
- This is a initial main program for testing purposes.
This program illustrates the simplest aspects of adding, deleting and reading
elements from Java
Collection's. It illustrates how
to create and use an
Iterator over a
It includes code for counting the number of adds and removes and for counting
the number of comparisons and number of collisions.