ADS
Algorithms and Data Structures
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
127namespace ADS
128{
129
193template< std::random_access_iterator It , class C = std::less<> >
194void nthElement( It first , It nth , It last , C less = C() );
195
199template< class T , class C = std::less<> >
200T 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/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
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...
Definition ADT.h:96