Problem Set 2

Due February 16, 11:59:59 pm.


2/8: An error in part 2 of problem 1 was discovered and has been corrected. The outputs given for inorderFoldl concat "" tree and inorderFoldr concat "" tree were incorrect.

Instructions: This problem set has three parts; you will write each in a separate file. Each file should have your name, netID, and what section you're in in a comment at the top. All programs that you submit must compile. Programs that do not compile will receive an automatic zero. If you are having trouble getting your assignment to compile, please visit consulting hours. If you run out of time, it is better to comment out the parts that do not compile and hand in a file that compiles, rather than handing in a more complete file that does not compile. Also, please continue to pay attention to style. Refer to the CS 312 style guide and lecture notes. Take the extra time to think out the problems and find the most elegant solutions before coding them up. As before, it is important that you do not change the names of the functions or structures.

When submitting your implementations for the following problems, you should be sure to include all of the code that you used to test your implementation. The completeness of these test cases will be a part of your grade. Even if your solution to a problem is well-written and correct, lack of exhaustive test cases could cost you points.