CS 1321 (Principles of Algorithm Design II):
Homework #2 Sample Solution

Sample solution code

Not available.

Testing

To run the test program yourself, copy the two files above (test-unary.cc and seq.h) into the directory containing your unary.h file and compile test-unary.cc. Then execute it. The program will print results from any tests that fail, or a message indicating that all tests were passed successfully. If the test program appears to hang, odds are good that some function in unary.h is in an infinite loop.