Standard Template Library
The collection of genetic classes and functions is called Standard Template Library(STL).
Components of STL
Container is an object that actually stores data STL containers are implemented by template classes and therefore can be used with different data types. Example-Array(integer array, char array, float array)
ALGORITHM is a procedure that is used to process data present in container. Algorithms are implemented using template function.
The following tasks can be done using algorithms: Initialization, Searching, Sorting, Copying, Merging.etc.
Iterator is an object, like a pointer, that points to an element in a container one can increment/decrement iterators.
Iterator connects algorithm with containers
Type of Containers in STL
1. Sequence Container
2. Associative Container
3. Derived Container
Note:- Derived containers like stack, queue, priority queue do not support iterators, however they support two member functions, push() and pop().
Algorithms are not member function or friend function of any class. They are stand alone template functions.
Type of STL Algorithms
1. Retrieve or Non-mutating