ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
PigeonholeSort.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*------------------------- File PigeonholeSort.h --------------------------*/
3
/*--------------------------------------------------------------------------*/
25
/*--------------------------------------------------------------------------*/
26
/*----------------------------- DEFINITIONS --------------------------------*/
27
/*--------------------------------------------------------------------------*/
28
29
#ifndef __ADS_PigeonholeSort
30
#define __ADS_PigeonholeSort
31
/* self-identification: #endif constant */
32
33
/*--------------------------------------------------------------------------*/
34
/*------------------------------ INCLUDES ----------------------------------*/
35
/*--------------------------------------------------------------------------*/
36
37
#include "
ADS/Contract.h
"
38
#include "
ADS/sequence/List.h
"
39
#include "
ADS/sort/Sorted.h
"
40
41
#include <algorithm>
42
#include <stdexcept>
43
#include <utility>
44
#include <vector>
45
46
/*--------------------------------------------------------------------------*/
47
/*--------------------------- NAMESPACE ------------------------------------*/
48
/*--------------------------------------------------------------------------*/
49
50
namespace
ADS
51
{
52
73
template
<
class
V >
74
std::vector< std::pair< int , V > >
75
pigeonholeSort
(
const
std::vector< std::pair< int , V > > & A ,
int
k );
76
77
/*--------------------------------------------------------------------------*/
78
79
}
// end( namespace ADS )
80
81
/*--------------------------------------------------------------------------*/
82
/*-------------------------- IMPLEMENTATION --------------------------------*/
83
/*--------------------------------------------------------------------------*/
84
85
#include "ADS/sort/impl/PigeonholeSort.tpp"
86
87
/*--------------------------------------------------------------------------*/
88
89
#endif
/* PigeonholeSort.h included */
90
91
/*--------------------------------------------------------------------------*/
92
/*----------------------- End File PigeonholeSort.h ------------------------*/
93
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
List.h
The LIST of the book: a SEQUENCE [see ADT.h] realized as a bidirectional circular list of cells with ...
Sorted.h
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
ADS::pigeonholeSort
std::vector< std::pair< int, V > > pigeonholeSort(const std::vector< std::pair< int, V > > &A, int k)
the pairs sorted by key, the values of a key in their first order
ADS
Definition
ADT.h:96
ADS
sort
PigeonholeSort.h
Generated by
1.17.0