Name: ____________________________________________________ Alpha: _____________________

Describe help received: _________________________________________________________________

  1. [25pts] Compile the program above, and run it several times like this:
    time java HW0
    and then run it several times like this:
    time java HW0 X
    Compare the "real" times (which is actual seconds passed) for running with and without the commandline argument X (ignoring the crashes that may occasionally occur. Explain why it runs faster without the command-line argument.
  2. [25pts] Continuing with the above program, why does it crash occasionally when run with the command-line argument X?
  3. [10pts] Super challange: modify the Queue class (not HW0.java) so that HW0 doesn't crash when run with the command-line argument X? (attach code if you were successful)
  4. [40pts] Modify the main() below to use Iterators to print out the elements of the TreeSet. You'll want to look at Java API documentation for TreeSet. Attach code along with printout.