How can I represent the complexity of std::find_end algorithm as Big-O notation?
The complexity of std::find_end is defined as follows:
At most
(last2 - first2) * (last1 - first1 - (last2 - first2) + 1)
applications of the corresponding predicate.
It would be
O(M*(N-M)), whereNis the number of elements in the sequence 1, andMis the number of elements in the sequence 2.