Program Listing for File DidacticSorts.h

↰ Return to documentation for file (ADS/sort/DidacticSorts.h)

/*--------------------------------------------------------------------------*/
/*-------------------------- File DidacticSorts.h --------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef __ADS_DidacticSorts
 #define __ADS_DidacticSorts
                      /* self-identification: #endif constant */

/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/Contract.h"
#include "ADS/sort/Sorted.h"

#include <algorithm>
#include <cstddef>
#include <functional>
#include <random>
#include <utility>
#include <vector>

/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/

namespace ADS {

template< class T , class C = std::less<> >
void stoogeSort( std::vector< T > & A , C less = C() );

template< class T , class C = std::less<> >
void slowSort( std::vector< T > & A , C less = C() );

template< class T , class R , class C = std::less<> >
long bogoSort( std::vector< T > & A , R & g , C less = C() );

/*--------------------------------------------------------------------------*/

}  // end( namespace ADS )

/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/sort/impl/DidacticSorts.tpp"

/*--------------------------------------------------------------------------*/

#endif  /* DidacticSorts.h included */

/*--------------------------------------------------------------------------*/
/*------------------------ End File DidacticSorts.h ------------------------*/
/*--------------------------------------------------------------------------*/