Program Listing for File HeapByInsertion.h

↰ Return to documentation for file (ADS/tree/HeapByInsertion.h)

/*--------------------------------------------------------------------------*/
/*------------------------- File HeapByInsertion.h -------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

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

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

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

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

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

namespace ADS {

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

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

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

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

}  // end( namespace ADS )

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

#include "ADS/tree/impl/HeapByInsertion.tpp"

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

#endif  /* HeapByInsertion.h included */

/*--------------------------------------------------------------------------*/
/*----------------------- End File HeapByInsertion.h -----------------------*/
/*--------------------------------------------------------------------------*/