Template Function ADS::mergeSortRec
Defined in File MergeSort.h
Function Documentation
-
template<class T, class C = std::less<>>
void ADS::mergeSortRec(std::vector<T> &A, std::vector<T> &B, std::size_t start, std::size_t end, std::size_t cutoff, C less = C(), long long *inv = nullptr) MergeSortRec() of A[ start .
. end ], insertionSort() below cutoff items; with cutoff > 1 also no merge of two parts already in order, i.e., with A[ mid ] <= A[ mid + 1 ], which makes the sort of a sorted vector take n - 1 comparisons
- Pre:
start <= end < n <= | B | and cutoff >= 1