Class 26 Objectives
At the end of today's class you should
KNOW:
- That set-structure! is needed when two pieces of data contain
each other
- That programming a 2-way family tree is no more complicated than
programming a 1-way family tree (as long as you are
writing programs that do processing in one direction at a time)
BE ABLE TO:
- Use set-structure! to define cyclic data
- Use set-structure! to add/remove nodes from a 2-way family tree
- Write functions that process 2-way family trees
Sample Exam Question:
Using the data definition for a 2-way family tree that we developed in
class, write a function people-without-kids, which
consumes a person and returns a
list of names of childless people who are descendants of the given person.
;; people-without-kids: Person -> ListOfString
;; consumes a person and returns a list of names of people
;; in that person's descendant family tree who have no kids