C++ Algorithm Function adjacent_find()
C++ Algorithm adjacent_find() function performs a search operation on the range [first, last] for the very first occurrence of two consecutive matching elements. If such elements are found then an iterator to the first element of the two is returned. Otherwise, the last element is returned.
first: It is a forward iterator to the first element in the range.
last: It is a forward iterator to the last element in the range.
pred: It is a binary function that accepts two elements as arguments and performs the task designed by the function.
The function returns an iterator to the first element of the range[first,last) if two consecutive matching elements are found else the last element is returned.
In the given range the first pair of sequence that is repeated are: 50 In the given range the second pair of sequence that is repeated are: 60
The complexity of the function is linear up to a distance between the first and last element.
Some or all of the elements of the range are accessed.
The function throws an exception if any of the argument throws one.