Template Function ADS::fibonacciSearch

Function Documentation

template<class T>
long ADS::fibonacciSearch(const std::vector<T> &A, const T &v, long *cmp = nullptr)

the Fibonacci search of v in the sorted A: its place, or -1; the comparisons go to *cmp, if given

Pre:

A is sorted (an audit)

Post:

the result is -1 if and only if v is not in A