Assignment #11: Abstracting Functions

Out: Wednesday, March 25th   Due: Thursday, April 2nd, 4:00pm

This homework must be done and submitted with your partner. Please see the submissions page for details on how to submit with your partner.



Questions

  1. Problem 21.1.2 from Section 21.1 of How to Design Programs
  2. Problem 21.2.1 from Section 21.2
  3. Problem 21.2.2
  4. Here is a data definition for a Tree (note the similarity to BT from from Assignment #8).
    ;; A Tree is one of ;; - Number ;; - (make-node Tree Tree) (define-struct node (left right))
    Design a function tree-sum which produces the sum of all of the numbers in a Tree. Then design a function tree-product which produces the produce of all of the numbers in a Tree. Then abstract these two functions into a new function, tree-op. Define new versions of tree-sum and tree-product using tree-op.