We have used different algorithms, which have to do with sorting:
| Algorithm | Purpose |
| std::sort | Accepts a range as arguments and simply sorts it. |
| std::is_sorted | Accepts a range as argument and tells if that range is sorted. |
| std::shuffle | This is, kind of, the reverse operation to sorting; it accepts a range as arguments and shuffles its items around. |
| std::partial_sort | Accepts a range as arguments and another iterator, which tells until where the input range should be sorted. Behind that iterator, the rest of the items appear unsorted. |
| std::partition | Accepts a range and a predicate function. All items for which the predicate function returns true are moved to the front of the range. The rest is moved to the back. |
For objects that do not have a comparison operator < implementation, it is possible to provide custom comparison functions. These should always have a signature such as bool function_name(const T &lhs, const T &rhs) and should not have any side effects during execution.
There are also other algorithms such as std::stable_sort, which also sort but preserve the order of items with the same sort key and std::stable_partition.
std::sort has different implementations for sorting. Depending on the nature of the iterator arguments, it is implemented as selection sort, insertion sort, merge sort, or completely optimized for a smaller number of items. On the user side, we usually do not even need to care.