Program Listing for File InsertionSort.h

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

/*--------------------------------------------------------------------------*/
/*-------------------------- File InsertionSort.h --------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

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

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

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

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

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

namespace ADS {

template< class T , class C = std::less<> >
void insertionSort( std::vector< T > & A , std::size_t lo , std::size_t hi ,
                    C less = C() );

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

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

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

}  // end( namespace ADS )

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

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

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

#endif  /* InsertionSort.h included */

/*--------------------------------------------------------------------------*/
/*------------------------ End File InsertionSort.h ------------------------*/
/*--------------------------------------------------------------------------*/