Assignment #11: Abstracting FunctionsOut: 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.
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)) |
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.