Guided Practice 5.2: Descendant Trees
Question 1: Design a function person-double-name that takes a Person and returns a Person just like the given one, except that the Person and all of his descendants have their names doubled. For example,
(person-double-name
  (make-person "chuck" 
               (list (make-person "alice" empty) 
                     (make-person "bob" empty))))
=
(make-person "chuckchuck" 
             (list (make-person "alicealice" empty) 
                   (make-person "bobbob" empty)))
Remember that you will only learn something if you actually do it yourself.
Question 2: Design the following function:;; person-descendant? : Person String -> Boolean ;; GIVEN: a person and a name ;; RETURNS: true iff that person or any of his/her descendants has ;; that name.
;; EXAMPLES: ;; Given the persons in the lesson: (begin-for-test (check-true (person-descendant? fred "bob")) (check-true (person-descendant? chuck "bob")) (check-false (person-descendant? chuck "eddie")) (check-false (person-descendant? fred "eve")))
Last modified: Wed Aug 9 22:01:27 Eastern Daylight Time 2017