Pattern ITERATOR (cont.)


Solution

  1. Define an iterator class
    • External
    • Fetches one element at a time
  2. Each iterator object needs to keep track of the position of the next element to fetch

prev |top |next