ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
InterpolationSearch.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*----------------------- File InterpolationSearch.h -----------------------*/
3/*--------------------------------------------------------------------------*/
39/*--------------------------------------------------------------------------*/
40/*----------------------------- DEFINITIONS --------------------------------*/
41/*--------------------------------------------------------------------------*/
42
43#ifndef __ADS_InterpolationSearch
44 #define __ADS_InterpolationSearch
45/* self-identification: #endif constant */
46
47/*--------------------------------------------------------------------------*/
48/*------------------------------ INCLUDES ----------------------------------*/
49/*--------------------------------------------------------------------------*/
50
51#include "ADS/Contract.h"
52
53#include <algorithm>
54#include <vector>
55
56/*--------------------------------------------------------------------------*/
57/*--------------------------- NAMESPACE ------------------------------------*/
58/*--------------------------------------------------------------------------*/
59
60namespace ADS
61{
62
85template< class T , class F >
86long interpolationSearch( const std::vector< T > & A , const T & v ,
87 F && trace );
88
90template< class T >
91long interpolationSearch( const std::vector< T > & A , const T & v );
92
93/*--------------------------------------------------------------------------*/
94
95} // end( namespace ADS )
96
97/*--------------------------------------------------------------------------*/
98/*-------------------------- IMPLEMENTATION --------------------------------*/
99/*--------------------------------------------------------------------------*/
100
101#include "ADS/search/impl/InterpolationSearch.tpp"
102
103/*--------------------------------------------------------------------------*/
104
105#endif /* InterpolationSearch.h included */
106
107/*--------------------------------------------------------------------------*/
108/*--------------------- End File InterpolationSearch.h ---------------------*/
109/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
long interpolationSearch(const std::vector< T > &A, const T &v, F &&trace)
the place of in the sorted , or -1; trace( i , j , m ) on each probe (the ricercaInterpolata() of th...
Definition ADT.h:96