Lecture 27 Objectives (also listed under Lecture 24)
At the end of today's class you should
KNOW:
- To create data with references back and forth, we need to partially
create the items, then hook them up with set-structure! (as in Lecture 23)
- Programs that can hit the same data item twice need to remember which ones
they've visited to make sure the program stops.
BE ABLE TO:
- Recognize when a variable is needed to record which data items have been
visited.
Sample Exam Question:
In the webpage example from today's lecture, we used a variable to record
the fact that a particular webpage had already been visited. In a previous
offering of this course, a student suggested that the "visited" variable
be defined locally within the function count-pages. That won't
work - why not?