cpp/algorithm/minmax element

Finds the smallest and greatest element in the range.

@1@ Elements are compared using. @3@ Elements are compared using the given binary comparison function. @2,4@ Same as, but executed according to.

Return value
a pair consisting of an iterator to the smallest element as the first element and an iterator to the greatest element as the second. Returns if the range is empty. If several elements are equivalent to the smallest element, the iterator to the first such element is returned. If several elements are equivalent to the largest element, the iterator to the last such element is returned.

Complexity
At most $max(floor((3/2)*(N−1)), 0)$ applications of the predicate, where.