73#ifndef __ADS_Rearrangements
74 #define __ADS_Rearrangements
123template<
class T ,
class F >
124std::pair< std::size_t , std::size_t >
126 std::size_t * swaps =
nullptr );
146template<
class T ,
class C = std::less<> >
171template<
class T ,
class C = std::less<> >
172void sortKSorted( std::vector< T > & A , std::size_t k , C less = C() );
201template<
class T ,
class W = T >
202 requires std::is_arithmetic_v< T >
213#include "ADS/sequence/impl/Rearrangements.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
std::pair< std::size_t, std::size_t > dutchNationalFlag(std::vector< T > &A, F &&color, std::size_t *swaps=nullptr)
the items of by color( x ), 0 then 1 then 2, with reads of the colors and at most swaps,...
void sortKSorted(std::vector< T > &A, std::size_t k, C less=C())
sorted, each item at most places away from its place in the sorted order, by a heap of items;
void wiggleSort(std::vector< T > &A, C less=C())
, by swaps of neighbors; comparisons
std::pair< std::size_t, W > minimumSwapSort(const std::vector< T > &A)
the fewest swaps that sort , and the least total cost of the swaps that sort it, a swap costing the s...