Template Function ADS::largestGap

Function Documentation

template<class T>
std::optional<std::pair<T, T>> ADS::largestGap(std::vector<std::pair<T, T>> I)

largestGap(): the longest stretch ( x , y ), between the first start and the last end, covered by none of the closed intervals I, the first one on ties, or nothing; O( n log n )

Pre:

a <= b for each interval [ a , b ]

Post:

no interval meets ( x , y ) (an audit)