cpp/algorithm/max element

Finds the 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
Iterator to the greatest element in the range. If several elements in the range are equivalent to the greatest element, returns the iterator to the first such element. Returns if the range is empty.

Complexity
Exactly $max(N-1,0)$ comparisons, where.