Lecture 17
Learning objectives
After this class, you should be able to:
- Implement iterators.
- Write generic algorithms that use iterators.
Reading assignment
- Chapters 8 and 14 of 2003 lecture notes, available in the Course Library on blackboard, under the Iterators and Generic Algorithms folder.
- Page 215 and 216.
Exercises and review questions
- Exercises and review questions on current lecture's material
- Write a singly-linked list class and implement an iterator for it.
- Write a program that uses the classes you wrote for the above question. This program should insert a few
int
s into your linked list object, and use an iterator to go through the entire list and output its contents.- Questions on next lecture's material
- Draw any tree that you wish to, such as a family tree, or the tree of an organization for which you work. What is the height of your tree? Which node is the root of the tree.
Last modified: 4 Feb 2008