C++ STL: Algorithm
The header file algorithm contains a wide-ranging collection of template functions for manipulating containers. The carry out in an efficient manner most of the standard algorithms for copying, sorting and searching. The scope of these functions isn't limited to STL containers but can be applied to any container which satisfies a given set of structural properties. This remarkably generic behaviour is made possible by the use of iterators to access the elements stored in the containers.
As much as possible, you should avoid coding your own version of a well-known algorithm. It's much better to use the tools in algorithm which have been written and tested by professionals on many different platforms. Using the STL implementation accelerates the development of your program, makes it easier to read and enhances its performance. The STL algorithms are very well-optimized and it's generally futile to reinvent them.
The following snippet illustrates some of the functionality of this library.