Minimum and Maximum
We can determine the minimum and maximum elements of the range with
std::max_element. If we want to find both the minimum and maximum pair of a range then we can use the algorithm,
std::minmax_element. Each algorithm can be configured with a binary predicate.
std::min_element: Returns the minimum element of the range.