ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
NthElement.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*-------------------------- File NthElement.h -----------------------------*/
3
/*--------------------------------------------------------------------------*/
101
/*--------------------------------------------------------------------------*/
102
/*----------------------------- DEFINITIONS --------------------------------*/
103
/*--------------------------------------------------------------------------*/
104
105
#ifndef __ADS_NthElement
106
#define __ADS_NthElement
107
/* self-identification: #endif constant */
108
109
/*--------------------------------------------------------------------------*/
110
/*------------------------------ INCLUDES ----------------------------------*/
111
/*--------------------------------------------------------------------------*/
112
113
#include "
ADS/Contract.h
"
114
115
#include <cmath>
116
#include <cstddef>
117
#include <functional>
118
#include <iterator>
119
#include <memory>
120
#include <utility>
121
#include <vector>
122
123
/*--------------------------------------------------------------------------*/
124
/*--------------------------- NAMESPACE ------------------------------------*/
125
/*--------------------------------------------------------------------------*/
126
127
namespace
ADS
128
{
129
193
template
< std::random_access_iterator It ,
class
C = std::less<> >
194
void
nthElement
( It first , It nth , It last , C less = C() );
195
199
template
<
class
T ,
class
C = std::less<> >
200
T
nthElement
( std::vector< T > & A , std::size_t k , C less = C() );
201
202
/*--------------------------------------------------------------------------*/
203
204
}
// end( namespace ADS )
205
206
/*--------------------------------------------------------------------------*/
207
/*-------------------------- IMPLEMENTATION --------------------------------*/
208
/*--------------------------------------------------------------------------*/
209
210
#include "ADS/search/impl/NthElement.tpp"
211
212
/*--------------------------------------------------------------------------*/
213
214
#endif
/* NthElement.h included */
215
216
/*--------------------------------------------------------------------------*/
217
/*------------------------- End File NthElement.h --------------------------*/
218
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::nthElement
void nthElement(It first, It nth, It last, C less=C())
the item of its rank put in nth, in by less(), the items before it not larger and those after it not...
ADS
Definition
ADT.h:96
ADS
search
NthElement.h
Generated by
1.17.0