STL Algorithms & Iterators

I am trying to understand relationship between algorithms and iterators. What is a one pass algorithm and multipass algorithm.... what relationship does it have to iterators ? Also what does retaining a state of an iterator mean ?

Thanks!
A one-pass algorithm walks the data structure on which it operates exactly once. A multi-pass algorithm walks
it more than once. A linear search, for example, can be thought of as a one-pass algorithm: it will traverse the
list no more than once. A bubble sort, for example, is a multi-pass algorithm: it walks the list multiple times.

Iterators are the means by which to walk a data structure, just as an integer index is the way you walk an array.
Topic archived. No new replies allowed.