C++ Programming/STL/Algorithms

Algorithms
The STL also provides several useful algorithms, in the form of template functions, that are provided to, with the help of the iterator concept, manipulate the STL containers (or derivations).

The STL algorithms aren't restricted to STL containers, for instance:


 * The _if suffix
 * The _copy suffix


 * Non-modifying algorithms
 * Modifying algorithms
 * Removing algorithms
 * Mutating algorithms
 * Sorting algorithms
 * Sorted range algorithms
 * Numeric algorithms

Minimum and maximum
The standard library provides function templates  and , which return the minimum and maximum of their two arguments respectively. Each has an overload available that allows you to customize the way the values are compared.

An example of how to use the Compare type parameter :