Fundamentals of Computer Science II (CSC-152 97F)
Outline of Class 34: Iterators and Ordered Structures
- I've started grading assignment
- Have you started the other homeworks?
- Another undocumented in-class detour.
- We've seen that iterators provide uniform mechanisms for stepping
through the elements of a structure.
- How might we implement them for our structures?
- Usually, we have our structures return iterators based on themselves.
- It is probably a bad idea to make a particular structure its own
iterator, since this makes it difficult to have multiple iterators
over the same structure.
- However, the iterator may need to know something about the internals
of the structure. That is, we'll need to define different iterators
for each of our structures.
- Most iterators will need to reference a current element in
the structure and also need a way to nondestructively advance the
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Wed Nov 5 09:52:07 1997.
This page generated on Wed Nov 5 12:38:26 1997 by SiteWeaver.
Contact our webmaster at email@example.com