CSci 1301: Problem Set 8

Due: Friday, November 5 at 11:59pm by e-mail

As always, please include a contract, a purpose, examples, and tests for each function.

Problem 1 (8 points)

Exercise 17.6.1. Important: the two given lists are already sorted!

Think carefully of test cases. Specifically, consider the cases in which at least one of the lists is empty or one of the lists only has one element. Write down these test cases and expected values before you write your function. These test cases will be graded.

Problem 2 (10 points)

Exercise 17.8.8. Two trees are the same if all of their nodes are the same (the same ssn, name, and the same position in the tree).

Once again, test the function carefully: test cases will be graded. To simplify generating test data, I will send the add-bst function (that we wrote in class) by e-mail.


CSci 1301 course web site.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.