Tag: Iterators
Overview
Iterators are a generalization of pointers, which means that we can have access to a sequence's elements without knowing the element type or the position.
An iterator is an object that can iterate or navigate or traverse over elements in the containers that represent data structures.
There are five iterator categories according to operations defined on them.
-
Bidirectional iterator performs forward and backward moving
-
Forward iterator may store and retrieve values
-
Input iterator reads forward and is provided by istream
-
Output iterator steps forward with write access and is provided by ostream and inserter
-
Random access iterator allows you to access elements in any order
CodeCogs®