|
Comp210: Principles of Computing and Programming
|
All problems will require all (applicable) steps from the design recipe, including a template. Before you tackle the homework, remind yourself of our General Advice, Advice on Homeworks (in particular: staple and provide questions), and the Grading Guidelines.
A short homework assignment for this week due to the exam.
Remember: Contract, purpose, header and test cases are always required!
Using the following data definition of FamTree (see lecture for details):
A FamTree is
-- (make-unknown symbol)
-- (make-child symbol number famTree famTree), where the symbol represents a name, the first FamTree is the mother's family tree, the second FamTree is the father's side, and the number is the birthyear.
write a function size-all: FamTree --> num , which counts the total number of nodes in a FamTree -- that is, the number of children and unknowns.
45 points total.
Last Revised Tuesday, 24-Aug-2004 13:49:22 CDT
©2004 Stephen Wong and Dung Nguyen