| | | | | |

List Iterator Public Interface

    bool      operator == (const iterator& I2) const;
    bool      operator != (const iterator& I2) const;
    iterator& operator =  (const iterator& I);
    T&        operator *  ();         // Return reference to current Tval
    const T&  operator *  () const;   // const version
    iterator& operator ++ ();         // prefix
    iterator  operator ++ (int);      // postfix
    iterator& operator -- ();         // prefix
    iterator  operator -- (int);      // postfix
    bool      Valid       () const;   // Iterator is (pointing to) a valid element
    
    
  • All iterator operations are required to run in time O(1) and space O(1).

| | Top of Page | 8. A Generic List Class and Linked Lists - 8 of 19