67#ifndef __ADS_SequenceQueries
68 #define __ADS_SequenceQueries
127template<
class T ,
class C = std::less<> >
154template< std::ranges::random_access_range R >
180 requires( std::is_arithmetic_v< T > && ! std::is_same_v< T , bool > )
181std::optional< std::pair< T , T > >
199template<
class T ,
class W = T >
200 requires std::is_arithmetic_v< T >
211#include "ADS/algorithm/impl/SequenceQueries.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Merge Sort (section 2.7.3): the two halves of the vector are sorted recursively and merged by mergePa...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
std::vector< std::size_t > smallerToTheRight(const std::vector< T > &A, C less=C())
the counts of the places with , by mergesort on the places;
W lineAssignment(std::vector< T > H, std::vector< T > L)
the least sum of over the permutations , computed in the type W, by sorting;
std::optional< std::pair< T, T > > largestGap(std::vector< std::pair< T, T > > I)
the longest stretch , between the first start and the last end, covered by none of the closed interva...
std::pair< std::size_t, std::size_t > longestKDistinctRun(const R &S, std::size_t k)
the start and the length of the first longest run of consecutive items of with at most distinct val...