CS 70

Group 6: Iterators

  • LHS Cow speaking

    This group of topics relate to understanding how to use and write iterators.

  • RHS Cow speaking

    Making it easier for the users of your class to iterate through all of the elements in a collection is one way to make your code easier to use. Thinking about how to implement an iterator is also a great way to think about the difference between interface and implementation!

Topics

You will know that you have achieved this group of learning objectives when you are able to

  • Goal 6A: Iterator Definition:
    • Explain what iterators are and why they are useful.
  • Goal 6B: Using Iterators:
    • Read and write C++ code using the standard C++ iterator idiom, including:
      • const iterator
      • const_iterator
  • Goal 6C: Iterator Interface:
    • Explain the required outcomes of begin, end, and iterator operations in the C++ iterator interface.
  • Goal 6D: Iterator validity:
    • Explain why iterators can cease to be valid and identify common operations that cause iterators to no longer be valid.

Need More Practice?

This group of goals are addressed in the following places:

(When logged in, completion status appears here.)