C++ Reference Material
STL Algorithm Overview
The pages on algorithms contain both a listing of all STL algorithms in alphabetical order, and all algorithms grouped by purpose. The alphabetical listing is the most detailed and complete and it is that listing that is described in what follows.
The entry for each algorithm shows each variation of the algorithm interface, and includes a brief description of what each version of the algorithm does.
Each algorithm entry also includes one or more links to sample programs illustrating the use of each algorithm version. So, for example, doit1a.cpp is the first sample program for the first (or only) listed interface of algorithm doit, while doit2c.cpp would be used for the name of the third sample program for the second interface of that same algorithm, if there were in fact such an interface and such a program.
Note that, for simplicity and consistency, unless there is a good reason to do otherwise, the first sample program illustrating any given algorithm will use one or more "vector of integer" containers only, wherever this is possible and makes sense. Additional sample programs for that algorithm, if any, may or may not use other kinds of containers, other kinds of component values, and/or other STL features.
To be most helpful in the shortest possible time, an algorithm is first shown as it would look in a typical invocation. However, each algorithm entry also includes the full prototype for that algorithm, or that version of the algorithm. The formatting style of algorithm prototypes is designed to provide maximum readability in the current context, not to be conformant to any particular C++ formatting style guidelines.
Note also that in the "typical invocation" form of an algorithm, the name of a parameter is meant to suggest its type. The purpose of each parameter is given in the brief description which follows the "typical invocation" form of the algorithm, according to the naming conventions used on this site. In the full prototype form of any algorithm, both parameter types and parameter names appear, so in this context a parameter name can be used to indicate the purpose of the parameter. Thus it may be helpful, even for a casual user, to look at both the typical invocation form and the full prototype form of any algorithm of interest.
Many algorithms are implemented as void functions, for which the return value is indicated as "none". For those that are not, a description of the value returned by the algorithm is given.
Most of the algorithms are made accessible by including the header file <algorithm> in your source code, but a few come from <numeric>. In actual fact, the algorithms in <numeric> are not technically part of the STL. However, they are fully compatible with the STL, and virtually indistinguishable from the "official" STL algorithms, and so are included here for the sake of completeness and convenience. Which of the two header files should be used to get access to any particular algorithm is indicated in the subsection header for that algorithm, following the name of the algorithm.
Once again, a reminder that before studying or using a particular algorithm it would be wise to familiarize yourself with the naming conventions used on this site.