previous | index | next

Exercise 8.8, p. 222

Write a procedure called height that behaves like:
     (height (make-leaf 3)) ⇒ 0

     (height bushy-tree) ⇒ 2

     (height branchless-tree) ⇒ 6
Facts about binary trees:
  • If a tree is composed of a single leaf, its height is ___?___.
(define height
  (lambda (tree)
    (cond (___?___))))

previous | index | next