Implementing Iterator pattern of a single Linked List |  ; creating a list ; elements to be added at the end . in the above created list . ; elements of list are retrieved through iterator .
#include <bits/stdc++.h> NEW_LINE using namespace std ; int main ( ) { vector < int > list ; list . push_back ( 1 ) ; list . push_back ( 2 ) ; list . push_back ( 3 ) ; for ( vector < int > :: iterator it = list . begin ( ) ; it != list . end ( ) ; ++ it ) cout << * it << " ▁ " ; return 0 ; }