Lecture 23 Objectives
At the end of today's class you should
KNOW:
- That a graph is a data structure formed of nodes and edges. There are
many ways to implement graphs.
- That to create data that contains cycles, you need to partially create
the datum without the cycles, then use mutation to add the cycles. (We did
this with DrRacket when we had mothers with children and children who had
a mother.)
- That programs might not terminate if the data they process contains
loops.
BE ABLE TO:
- Create examples of data that contain cycles
Sample Exam Question:
At the end of today's lecture, we found ourselves in an infinite loop
related to the cycles in the graph data. In a sentence or two, suggest a way to prevent the infinite loop. (Hint: how did we prevent infinite loops in Racket when
there were cycles in the data?)